OSSP CVS Repository

ossp - Check-in [3302]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 3302
Date: 2003-Mar-07 16:04:50 (local)
2003-Mar-07 15:04:50 (UTC)
User:rse
Branch:
Comment: Now that we immediately close the fd on MM_SHMT_MMZERO and MM_SHMT_MMFILE, we can avoid setting the FD_CLOEXEC just two calls before close(2).
Tickets:
Inspections:
Files:
ossp-pkg/mm/mm_core.c      1.20 -> 1.21     0 inserted, 8 deleted

ossp-pkg/mm/mm_core.c 1.20 -> 1.21

--- mm_core.c    2003/03/07 14:59:15     1.20
+++ mm_core.c    2003/03/07 15:04:50     1.21
@@ -271,10 +271,6 @@
 #if defined(MM_SHMT_MMZERO)
     if ((fdmem = open("/dev/zero", O_RDWR, MM_CORE_FILEMODE)) == -1)
         FAIL(MM_ERR_CORE|MM_ERR_SYSTEM, "failed to open /dev/zero");
-#if defined(F_SETFD) && defined(FD_CLOEXEC)
-    if (fcntl(fdmem, F_SETFD, FD_CLOEXEC) == -1)
-        FAIL(MM_ERR_CORE|MM_ERR_SYSTEM, "failed to set close-on-exec flag");
-#endif
     if (lseek(fdmem, mm_core_mapoffset+size, SEEK_SET) == -1)
         FAIL(MM_ERR_CORE|MM_ERR_SYSTEM, "failed to seek in /dev/zero");
     write(fdmem, &zero, sizeof(zero));
@@ -289,10 +285,6 @@
     unlink(fnmem);
     if ((fdmem = open(fnmem, O_RDWR|O_CREAT|O_EXCL, MM_CORE_FILEMODE)) == -1)
         FAIL(MM_ERR_CORE|MM_ERR_SYSTEM, "failed to open memory file");
-#if defined(F_SETFD) && defined(FD_CLOEXEC)
-    if (fcntl(fdmem, F_SETFD, FD_CLOEXEC) == -1)
-        FAIL(MM_ERR_CORE|MM_ERR_SYSTEM, "failed to set close-on-exec flag");
-#endif
     if (ftruncate(fdmem, mm_core_mapoffset+size) == -1)
         FAIL(MM_ERR_CORE|MM_ERR_SYSTEM, "failed to truncate memory file");
     write(fdmem, &zero, sizeof(zero));

CVSTrac 2.0.1