aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-02-21 14:29:07 +0000
committerUlrich Drepper <drepper@redhat.com>1999-02-21 14:29:07 +0000
commit13f2ac59bff417b69de02939230cfc1aca73f37c (patch)
tree22513cc88b5200feebb4fb79dc1af20a30d36978
parentf6b56b5530b00432e5492642487c0a67e8646f9e (diff)
downloadglibc-13f2ac59bff417b69de02939230cfc1aca73f37c.tar
glibc-13f2ac59bff417b69de02939230cfc1aca73f37c.tar.gz
glibc-13f2ac59bff417b69de02939230cfc1aca73f37c.tar.bz2
glibc-13f2ac59bff417b69de02939230cfc1aca73f37c.zip
Update.
1999-02-21 Andreas Jaeger <aj@arthur.rhein-neckar.de> * sysdeps/generic/glob.c (glob): Save previous errno.
-rw-r--r--ChangeLog4
-rw-r--r--sysdeps/generic/glob.c9
2 files changed, 10 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 2f0205c6fe..772d78523c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+1999-02-21 Andreas Jaeger <aj@arthur.rhein-neckar.de>
+
+ * sysdeps/generic/glob.c (glob): Save previous errno.
+
1999-02-21 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/generic/glob.c (glob): Enlarge buffers for reentrant
diff --git a/sysdeps/generic/glob.c b/sysdeps/generic/glob.c
index 977ce1509d..d624655718 100644
--- a/sysdeps/generic/glob.c
+++ b/sysdeps/generic/glob.c
@@ -642,6 +642,7 @@ glob (pattern, flags, errfunc, pglob)
size_t pwbuflen = sysconf (_SC_GETPW_R_SIZE_MAX);
char *pwtmpbuf;
struct passwd pwbuf;
+ int save = errno;
if (pwbuflen == -1)
/* `sysconf' does not support _SC_GETPW_R_SIZE_MAX.
@@ -659,7 +660,7 @@ glob (pattern, flags, errfunc, pglob)
}
pwbuflen *= 2;
pwtmpbuf = (char *) __alloca (pwbuflen);
- __set_errno (0);
+ __set_errno (save);
}
# else
p = getpwnam (name);
@@ -726,6 +727,7 @@ glob (pattern, flags, errfunc, pglob)
size_t buflen = sysconf (_SC_GETPW_R_SIZE_MAX);
char *pwtmpbuf;
struct passwd pwbuf;
+ int save = errno;
if (buflen == -1)
/* `sysconf' does not support _SC_GETPW_R_SIZE_MAX. Try a
@@ -740,8 +742,9 @@ glob (pattern, flags, errfunc, pglob)
p = NULL;
break;
}
- pwtmpbuf = __alloca (buflen *= 2);
- __set_errno (0);
+ buflen *= 2;
+ pwtmpbuf = __alloca (buflen);
+ __set_errno (save);
}
# else
p = getpwnam (user_name);