about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-03-27 08:07:38 +0000
committerUlrich Drepper <drepper@redhat.com>2003-03-27 08:07:38 +0000
commit359b695d235bb516d964beb24f9b1a6d3a94e781 (patch)
tree5e357d749c9cc1c423c1e0c7d074052008bbdb90
parent312472fc4d34e810f414b633811b644dcc074d2d (diff)
downloadglibc-359b695d235bb516d964beb24f9b1a6d3a94e781.tar.gz
glibc-359b695d235bb516d964beb24f9b1a6d3a94e781.tar.xz
glibc-359b695d235bb516d964beb24f9b1a6d3a94e781.zip
(setfsuid): Use INTERNAL_SYSCALL and do not check for errors (unless testing for 32bit variant).
-rw-r--r--sysdeps/unix/sysv/linux/i386/setfsuid.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/sysdeps/unix/sysv/linux/i386/setfsuid.c b/sysdeps/unix/sysv/linux/i386/setfsuid.c
index a91afb91a7..9d425c0f9d 100644
--- a/sysdeps/unix/sysv/linux/i386/setfsuid.c
+++ b/sysdeps/unix/sysv/linux/i386/setfsuid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 2000, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -35,27 +35,28 @@ extern int __syscall_setfsuid32 (__kernel_uid32_t);
 #  if __ASSUME_32BITUIDS == 0
 /* This variable is shared with all files that need to check for 32bit
    uids.  */
-extern int __libc_missing_32bit_uids;
+extern int __libc_missing_32bit_uids attribute_hidden;
 #  endif
 # endif /* __NR_setfsuid32 */
 
 int
 setfsuid (uid_t uid)
 {
+  INTERNAL_SYSCALL_DECL (err);
 # if  __ASSUME_32BITUIDS > 0
-  return INLINE_SYSCALL (setfsuid32, 1, uid);
-# else  
+  /* No error checking. */
+  return INTERNAL_SYSCALL (setfsgid32, err, 1, gid);
+# else
 #  ifdef __NR_setfsuid32
   if (__libc_missing_32bit_uids <= 0)
     {
       int result;
-      int saved_errno = errno;
 
-      result = INLINE_SYSCALL (setfsuid32, 1, uid);
-      if (result == 0 || errno != ENOSYS)
+      result = INTERNAL_SYSCALL (setfsgid32, err, 1, gid);
+      if (! INTERNAL_SYSCALL_ERROR_P (result, err)
+	  || INTERNAL_SYSCALL_ERRNO (result, err) != ENOSYS)
 	return result;
 
-      __set_errno (saved_errno);
       __libc_missing_32bit_uids = 1;
     }
 #  endif /* __NR_setfsuid32 */
@@ -66,7 +67,8 @@ setfsuid (uid_t uid)
       return -1;
     }
 
-  return INLINE_SYSCALL (setfsuid, 1, uid);
+  /* No error checking. */
+  return INTERNAL_SYSCALL (setfsgid, err, 1, gid);
 # endif
 }
 #endif