mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-04-21 14:49:16 +02:00
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:
parent
d171e83347
commit
c70b497859
@ -743,13 +743,7 @@ g_get_user_database_entry (void)
|
|||||||
|
|
||||||
if (!pw)
|
if (!pw)
|
||||||
{
|
{
|
||||||
#ifndef __BIONIC__
|
|
||||||
setpwent ();
|
|
||||||
#endif
|
|
||||||
pw = getpwuid (getuid ());
|
pw = getpwuid (getuid ());
|
||||||
#ifndef __BIONIC__
|
|
||||||
endpwent ();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
if (pw)
|
if (pw)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user