summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common/__syscall_fcntl.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux/common/__syscall_fcntl.c')
-rw-r--r--libc/sysdeps/linux/common/__syscall_fcntl.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libc/sysdeps/linux/common/__syscall_fcntl.c b/libc/sysdeps/linux/common/__syscall_fcntl.c
index 17c67182e..86cc60d1a 100644
--- a/libc/sysdeps/linux/common/__syscall_fcntl.c
+++ b/libc/sysdeps/linux/common/__syscall_fcntl.c
@@ -39,6 +39,9 @@ int fcntl(int fd, int cmd, ...)
{
va_list ap;
long arg;
+#ifdef __NEW_THREADS
+ int oldtype, result;
+#endif
va_start (ap, cmd);
arg = va_arg (ap, long);
@@ -51,11 +54,11 @@ int fcntl(int fd, int cmd, ...)
return INLINE_SYSCALL(fcntl64, 3, fd, cmd, arg);
#endif
#ifdef __NEW_THREADS
- int oldtype = LIBC_CANCEL_ASYNC ();
+ oldtype = LIBC_CANCEL_ASYNC ();
#if defined __NR_fcntl
- int result = __NC(fcntl)(fd, cmd, arg);
+ result = __NC(fcntl)(fd, cmd, arg);
#else
- int result = INLINE_SYSCALL(fcntl64, 3, fd, cmd, arg);
+ result = INLINE_SYSCALL(fcntl64, 3, fd, cmd, arg);
#endif
LIBC_CANCEL_RESET (oldtype);
return result;