OSDN Git Service

getgroups.c: reorganize, include param.h instead of defining MIN
authorPeter S. Mazinger <ps.m@gmx.net>
Wed, 13 Apr 2011 19:52:44 +0000 (21:52 +0200)
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Fri, 15 Jun 2012 12:00:36 +0000 (14:00 +0200)
Include only what is necessary.
Mark __syscall_getgroups __always_inline.

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
libc/sysdeps/linux/common/getgroups.c

index ddc2cae..87fecce 100644 (file)
@@ -8,10 +8,7 @@
  */
 
 #include <sys/syscall.h>
-#include <stdlib.h>
 #include <unistd.h>
-#include <grp.h>
-
 
 #if defined(__NR_getgroups32)
 # undef __NR_getgroups
@@ -22,12 +19,14 @@ _syscall2(int, getgroups, int, size, gid_t *, list)
 _syscall2(int, getgroups, int, size, gid_t *, list)
 
 #else
+# include <errno.h>
+# include <stdlib.h>
+# include <sys/types.h>
+# include <sys/param.h>
 
-#define MIN(a,b) (((a)<(b))?(a):(b))
-
-#define __NR___syscall_getgroups __NR_getgroups
-static __inline__ _syscall2(int, __syscall_getgroups,
-               int, size, __kernel_gid_t *, list)
+# define __NR___syscall_getgroups __NR_getgroups
+static __always_inline
+_syscall2(int, __syscall_getgroups, int, size, __kernel_gid_t *, list)
 
 int getgroups(int size, gid_t groups[])
 {
@@ -56,5 +55,4 @@ ret_error:
        }
 }
 #endif
-
 libc_hidden_def(getgroups)