2003-04-22 Roland McGrath <roland@redhat.com>
authorRoland McGrath <roland@gnu.org>
Wed, 23 Apr 2003 01:54:03 +0000 (01:54 +0000)
committerRoland McGrath <roland@gnu.org>
Wed, 23 Apr 2003 01:54:03 +0000 (01:54 +0000)
* sysdeps/unix/sysv/linux/not-cancel.h: Put parens around macro args.
(open_not_cancel): Make last argument non-optional.
* sysdeps/generic/check_fds.c (check_one_fd): Update caller.
* sysdeps/unix/sysv/linux/gethostid.c (gethostid): Likewise.
* iconv/gconv_cache.c (__gconv_load_cache): Likewise.

iconv/gconv_cache.c
sysdeps/generic/check_fds.c
sysdeps/unix/sysv/linux/gethostid.c
sysdeps/unix/sysv/linux/not-cancel.h

index 8038f5f..6d19f9f 100644 (file)
@@ -60,7 +60,7 @@ __gconv_load_cache (void)
     return -1;
 
   /* See whether the cache file exists.  */
-  fd = open_not_cancel (GCONV_MODULES_CACHE, O_RDONLY);
+  fd = open_not_cancel (GCONV_MODULES_CACHE, O_RDONLY, 0);
   if (__builtin_expect (fd, 0) == -1)
     /* Not available.  */
     return -1;
index 8a3efd1..5ae3fee 100644 (file)
@@ -49,7 +49,7 @@ check_one_fd (int fd, int mode)
       /* Something is wrong with this descriptor, it's probably not
         opened.  Open /dev/null so that the SUID program we are
         about to start does not accidently use this descriptor.  */
-      int nullfd = open_not_cancel (_PATH_DEVNULL, mode);
+      int nullfd = open_not_cancel (_PATH_DEVNULL, mode, 0);
       /* We are very paranoid here.  With all means we try to ensure
         that we are actually opening the /dev/null device and nothing
         else.
index 4b587ce..5ef330b 100644 (file)
@@ -72,9 +72,9 @@ gethostid ()
   int fd;
 
   /* First try to get the ID from a former invocation of sethostid.  */
-  fd = open_not_cancel (HOSTIDFILE, O_RDONLY|O_LARGEFILE);
+  fd = open_not_cancel (HOSTIDFILE, O_RDONLY|O_LARGEFILE, 0);
   if (fd < 0)
-    fd = open_not_cancel (OLD_HOSTIDFILE, O_RDONLY|O_LARGEFILE);
+    fd = open_not_cancel (OLD_HOSTIDFILE, O_RDONLY|O_LARGEFILE, 0);
   if (fd >= 0)
     {
       ssize_t n = read_not_cancel (fd, &id, sizeof (id));
index cf61cff..fcd0187 100644 (file)
 
 /* Uncancelable open.  */
 #ifdef INLINE_SYSCALL
-# define open_not_cancel(name, flags, mode...) \
-  ({ int _mode = (0, ##mode);                                                \
-     INLINE_SYSCALL (open, 3, (const char *) name, flags, _mode); })
+# define open_not_cancel(name, flags, mode) \
+   INLINE_SYSCALL (open, 3, (const char *) (name), (flags), (mode))
 #endif
 
 /* Uncancelable close.  */
 #ifdef INLINE_SYSCALL
 # define close_not_cancel_no_status(fd) \
   (void) ({ INTERNAL_SYSCALL_DECL (err);                                     \
-           INTERNAL_SYSCALL (close, err, 1, fd); })
+           INTERNAL_SYSCALL (close, err, 1, (fd)); })
 #endif
 
 /* Uncancelable read.  */
 #ifdef INLINE_SYSCALL
 # define read_not_cancel(fd, buf, n) \
-  INLINE_SYSCALL (read, 3, fd, buf, n)
+  INLINE_SYSCALL (read, 3, (fd), (buf), (n))
 #endif
 
 /* Uncancelable write.  */
 #ifdef INLINE_SYSCALL
 # define write_not_cancel(fd, buf, n) \
-  INLINE_SYSCALL (write, 3, fd, buf, n)
+  INLINE_SYSCALL (write, 3, (fd), (buf), (n))
 #endif
 
 /* Uncancelable writev.  */
 #ifdef INLINE_SYSCALL
 # define writev_not_cancel_no_status(fd, iov, n) \
   (void) ({ INTERNAL_SYSCALL_DECL (err);                                     \
-           INTERNAL_SYSCALL (writev, err, 3, fd, iov, n); })
+           INTERNAL_SYSCALL (writev, err, 3, (fd), (iov), (n)); })
 #endif