From 11cf4e80748af05dd6c8f1d30609a5485bf28372 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sat, 26 Nov 2016 19:26:23 +0100 Subject: fixup gcc warnings Remove following warning from common code: warning: ISO C90 forbids mixed declarations and code --- libc/sysdeps/linux/common/open.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'libc/sysdeps/linux/common/open.c') 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; -- cgit v1.2.3