diff options
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/generic/glob.c | 6 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/gethostid.c | 3 |
2 files changed, 4 insertions, 5 deletions
diff --git a/sysdeps/generic/glob.c b/sysdeps/generic/glob.c index b48dd7c84a..9b134c5a0d 100644 --- a/sysdeps/generic/glob.c +++ b/sysdeps/generic/glob.c @@ -650,13 +650,12 @@ glob (pattern, flags, errfunc, pglob) pwbuflen = 1024; pwtmpbuf = (char *) __alloca (pwbuflen); - success = 1; while (getpwnam_r (name, &pwbuf, pwtmpbuf, pwbuflen, &p) != 0) { if (errno != ERANGE) { - success = 0; + p = NULL; break; } pwbuflen *= 2; @@ -665,9 +664,8 @@ glob (pattern, flags, errfunc, pglob) } # else p = getpwnam (name); - success = p != NULL; # endif - if (success) + if (p != NULL) home_dir = p->pw_dir; } } diff --git a/sysdeps/unix/sysv/linux/gethostid.c b/sysdeps/unix/sysv/linux/gethostid.c index f2ebbf2b6a..6f501e391d 100644 --- a/sysdeps/unix/sysv/linux/gethostid.c +++ b/sysdeps/unix/sysv/linux/gethostid.c @@ -91,7 +91,8 @@ gethostid () /* To get the IP address we need to know the host name. */ while (__gethostbyname_r (hostname, &hostbuf, buffer, buflen, &hp, &herr) - != 0) + != 0 + || hp == NULL) if (herr != NETDB_INTERNAL || errno != ERANGE) return 0; else |