[git commit] platform.h: define endgrent() and endpwent() as no-ops on Android

Denys Vlasenko vda.linux at googlemail.com
Fri Jan 6 15:23:18 UTC 2012


commit: http://git.busybox.net/busybox/commit/?id=6b64a269766ace40c56826738de446537add37de
branch: http://git.busybox.net/busybox/commit/?id=refs/heads/master

Surprisingly, bionic libc seems to lack these functions.

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 include/grp_.h     |    2 +-
 include/platform.h |    5 +++++
 include/pwd_.h     |    2 +-
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/include/grp_.h b/include/grp_.h
index 5c24d55..82ad904 100644
--- a/include/grp_.h
+++ b/include/grp_.h
@@ -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
diff --git a/include/platform.h b/include/platform.h
index d79cc97..7451fb7 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -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? ------------------------------------ */
 
diff --git a/include/pwd_.h b/include/pwd_.h
index e40b71d..ea158da 100644
--- a/include/pwd_.h
+++ b/include/pwd_.h
@@ -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


More information about the busybox-cvs mailing list