diff options
Diffstat (limited to 'nss')
-rw-r--r-- | nss/nss_db/db-XXX.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/nss/nss_db/db-XXX.c b/nss/nss_db/db-XXX.c index 8ba73efcb6..7356b34462 100644 --- a/nss/nss_db/db-XXX.c +++ b/nss/nss_db/db-XXX.c @@ -73,9 +73,9 @@ internal_setent (int stayopen) } else { - /* We have to make sure the file is `closed on exec'. */ + /* 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) @@ -84,11 +84,14 @@ internal_setent (int stayopen) result = -1; } else - result = flags = fcntl (fd, F_GETFD, 0); - if (result >= 0) { - flags |= FD_CLOEXEC; - result = fcntl (fd, F_SETFD, flags); + int flags = result = fcntl (fd, F_GETFD, 0); + + if (result >= 0) + { + flags |= FD_CLOEXEC; + result = fcntl (fd, F_SETFD, flags); + } } if (result < 0) { |