summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common/ioctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux/common/ioctl.c')
-rw-r--r--libc/sysdeps/linux/common/ioctl.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libc/sysdeps/linux/common/ioctl.c b/libc/sysdeps/linux/common/ioctl.c
index 9a00e614a..374b6247b 100644
--- a/libc/sysdeps/linux/common/ioctl.c
+++ b/libc/sysdeps/linux/common/ioctl.c
@@ -20,6 +20,9 @@ int ioctl(int fd, unsigned long int request, ...)
{
void *arg;
va_list list;
+#ifdef __NEW_THREADS
+ int oldtype, result;
+#endif
va_start(list, request);
arg = va_arg(list, void *);
@@ -28,8 +31,8 @@ int ioctl(int fd, unsigned long int request, ...)
if (SINGLE_THREAD_P)
return __syscall_ioctl(fd, request, arg);
#ifdef __NEW_THREADS
- int oldtype = LIBC_CANCEL_ASYNC ();
- int result = __syscall_ioctl(fd, request, arg);
+ oldtype = LIBC_CANCEL_ASYNC ();
+ result = __syscall_ioctl(fd, request, arg);
LIBC_CANCEL_RESET (oldtype);
return result;
#endif