about summary refs log tree commit diff
path: root/nss/nss_db/db-alias.c
diff options
context:
space:
mode:
Diffstat (limited to 'nss/nss_db/db-alias.c')
-rw-r--r--nss/nss_db/db-alias.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/nss/nss_db/db-alias.c b/nss/nss_db/db-alias.c
index 81037ed5f7..bc9eea8a20 100644
--- a/nss/nss_db/db-alias.c
+++ b/nss/nss_db/db-alias.c
@@ -1,5 +1,5 @@
 /* Mail alias file parser in nss_db module.
-   Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
 
@@ -60,7 +60,7 @@ internal_setent (int stayopen)
 	{
 	  /* 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)
@@ -69,12 +69,13 @@ 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);
+	      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