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
This commit is contained in:
Robert Bragg 2013-04-17 04:35:50 -04:00 committed by Colin Walters
parent d171e83347
commit c70b497859

View File

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