diff options
author | Ulrich Drepper <drepper@redhat.com> | 1999-01-25 11:00:16 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1999-01-25 11:00:16 +0000 |
commit | b57018905f25910ac0a4af81e3ea61629a1783e9 (patch) | |
tree | 4471157391f5871970e71414518da16a6c2fcf13 /nss/nss_db/db-netgrp.c | |
parent | 4353f9bef4c341036bc21816c8f011072fafbee5 (diff) | |
download | glibc-b57018905f25910ac0a4af81e3ea61629a1783e9.zip glibc-b57018905f25910ac0a4af81e3ea61629a1783e9.tar.gz glibc-b57018905f25910ac0a4af81e3ea61629a1783e9.tar.bz2 |
Update.
1999-01-26 Geoff Keating <geoffk@ozemail.com.au>
* nss/nss_db/db-netgrp.c (_nss_db_setnetgrent): Suppress warning
about potentially uninitialized `flags'.
* nss/nss_db/db-alias.c (internal_setent): Likewise.
1999-01-25 Andreas Jaeger <aj@arthur.rhein-neckar.de>
* elf/failobj.c: Provide prototype for xyzzy.
1999-01-25 Philip Blundell <pb@nexus.co.uk>
* sysdeps/unix/sysv/linux/arm/clone.S: Correct error check again.
Diffstat (limited to 'nss/nss_db/db-netgrp.c')
-rw-r--r-- | nss/nss_db/db-netgrp.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/nss/nss_db/db-netgrp.c b/nss/nss_db/db-netgrp.c index 8707d85..722281d 100644 --- a/nss/nss_db/db-netgrp.c +++ b/nss/nss_db/db-netgrp.c @@ -1,5 +1,5 @@ /* Netgroup file parser in nss_db modules. - Copyright (C) 1996, 1997 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996. @@ -61,7 +61,7 @@ _nss_db_setnetgrent (const char *group) { /* We have to make sure the file is `closed on exec'. */ int fd; - int result, flags; + int result; err = db->fd (db, &fd); if (err != 0) @@ -70,12 +70,13 @@ _nss_db_setnetgrent (const char *group) result = -1; } else - result = flags = fcntl (fd, F_GETFD, 0); - if (result >= 0) { - flags |= FD_CLOEXEC; - result = fcntl (fd, F_SETFD, flags); + result = fcntl (fd, F_GETFD, 0); + + if (result >= 0) + result = fcntl (fd, F_SETFD, result | FD_CLOEXEC); } + if (result < 0) { /* Something went wrong. Close the stream and return a |