[glib] utils: avoid redundant set/endpwent around getpwuid
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] utils: avoid redundant set/endpwent around getpwuid
- Date: Wed, 17 Apr 2013 10:07:46 +0000 (UTC)
commit c70b4978598a3b4e3d712e89cacf21b5369ed53e
Author: Robert Bragg <robert linux intel com>
Date: Wed Apr 17 04:35:50 2013 -0400
utils: avoid redundant set/endpwent around getpwuid
set/endpwent are only required for iterating through passwd entries
using getpwent(). Since we are explicitly requesting a passwd entry
for a uid then the set/endpwent calls are redundant.
Removing these redundant calls is required for building on Android
since their C library doesn't implement these.
https://bugzilla.gnome.org/show_bug.cgi?id=645881
glib/gutils.c | 6 ------
1 file changed, 6 deletions(-)
---
diff --git a/glib/gutils.c b/glib/gutils.c
index 4a4c1a5..2d049b1 100644
--- a/glib/gutils.c
+++ b/glib/gutils.c
@@ -743,13 +743,7 @@ g_get_user_database_entry (void)
if (!pw)
{
-#ifndef __BIONIC__
- setpwent ();
-#endif
pw = getpwuid (getuid ());
-#ifndef __BIONIC__
- endpwent ();
-#endif
}
if (pw)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]