platform.h: define endgrent() and endpwent() as no-ops on Android
authorDenys Vlasenko <vda.linux@googlemail.com>
Fri, 6 Jan 2012 15:23:18 +0000 (16:23 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Fri, 6 Jan 2012 15:23:18 +0000 (16:23 +0100)
Surprisingly, bionic libc seems to lack these functions.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
include/grp_.h
include/platform.h
include/pwd_.h

index 5c24d558ad1cc14a971cf2d7df88f28f4e384ee9..82ad904921ffd37e910b766b0c38d5cc421d7866 100644 (file)
@@ -29,7 +29,7 @@ PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
  * We will use libc-defined structures, but will #define function names
  * so that function calls are directed to bb_internal_XXX replacements
  */
-
+#undef endgrent
 #define setgrent     bb_internal_setgrent
 #define endgrent     bb_internal_endgrent
 #define getgrent     bb_internal_getgrent
index d79cc97e5a9bb843cfa3345219c6fbafee8cc6c9..7451fb7572224bb63b101453c28087e3a5bc0ea1 100644 (file)
@@ -334,6 +334,11 @@ typedef unsigned smalluint;
 # define MAXSYMLINKS SYMLOOP_MAX
 #endif
 
+#if defined(ANDROID) || defined(__ANDROID__)
+# define endpwent() ((void)0)
+# define endgrent() ((void)0)
+#endif
+
 
 /* ---- Who misses what? ------------------------------------ */
 
index e40b71dab55d817be9e87d7c6ac010dcb7e7d15b..ea158da45211495ae83904d1026ccb6bca7b2175 100644 (file)
@@ -30,7 +30,7 @@ PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
  * We will use libc-defined structures, but will #define function names
  * so that function calls are directed to bb_internal_XXX replacements
  */
-
+#undef endpwent
 #define setpwent    bb_internal_setpwent
 #define endpwent    bb_internal_endpwent
 #define getpwent    bb_internal_getpwent