summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common/open.c
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@uclibc-ng.org>2016-11-26 19:26:23 +0100
committerWaldemar Brodkorb <wbx@uclibc-ng.org>2016-11-27 16:35:31 +0100
commit11cf4e80748af05dd6c8f1d30609a5485bf28372 (patch)
tree46520c787506bd925a0f142dc92bd141ec736939 /libc/sysdeps/linux/common/open.c
parent8ccf7c3e8c725e9fc29ad0f5accebb127c9ea246 (diff)
fixup gcc warnings
Remove following warning from common code: warning: ISO C90 forbids mixed declarations and code
Diffstat (limited to 'libc/sysdeps/linux/common/open.c')
-rw-r--r--libc/sysdeps/linux/common/open.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libc/sysdeps/linux/common/open.c b/libc/sysdeps/linux/common/open.c
index fd37ea0f0..bfcb341de 100644
--- a/libc/sysdeps/linux/common/open.c
+++ b/libc/sysdeps/linux/common/open.c
@@ -28,6 +28,9 @@ int __open_nocancel(const char *, int, mode_t) __nonnull ((1)) attribute_hidden;
int open(const char *file, int oflag, ...)
{
mode_t mode = 0;
+#ifdef __NEW_THREADS
+ int oldtype, result;
+#endif
if (oflag & O_CREAT) {
va_list arg;
@@ -44,11 +47,11 @@ int open(const char *file, int oflag, ...)
#endif
#ifdef __NEW_THREADS
- int oldtype = LIBC_CANCEL_ASYNC ();
+ oldtype = LIBC_CANCEL_ASYNC ();
# if defined(__NR_open)
- int result = __NC(open)(file, oflag, mode);
+ result = __NC(open)(file, oflag, mode);
# else
- int result = openat(AT_FDCWD, file, oflag, mode);
+ result = openat(AT_FDCWD, file, oflag, mode);
# endif
LIBC_CANCEL_RESET (oldtype);
return result;