Browse Source

getgroups.c: reorganize, include param.h instead of defining MIN

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>
Peter S. Mazinger 13 years ago
parent
commit
ca89d7e1fb
1 changed files with 7 additions and 9 deletions
  1. 7 9
      libc/sysdeps/linux/common/getgroups.c

+ 7 - 9
libc/sysdeps/linux/common/getgroups.c

@@ -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)