--- mm_core.c 2002/07/26 13:34:53 1.15
+++ mm_core.c 2002/07/26 13:48:38 1.16
@@ -249,7 +249,7 @@
#if defined(MM_SHMT_MMPOSX)
shm_unlink(fnmem); /* Ok when it fails */
- if ((fdmem = shm_open(fnmem, O_RDWR|O_CREAT, MM_CORE_FILEMODE)) == -1)
+ if ((fdmem = shm_open(fnmem, O_RDWR|O_CREAT|O_EXCL, MM_CORE_FILEMODE)) == -1)
FAIL(MM_ERR_CORE|MM_ERR_SYSTEM, "failed to open tempfile");
if (ftruncate(fdmem, mm_core_mapoffset+size) == -1)
FAIL(MM_ERR_CORE|MM_ERR_SYSTEM, "failed to truncate tempfile");
@@ -275,7 +275,7 @@
#if defined(MM_SHMT_MMFILE)
unlink(fnmem);
- if ((fdmem = open(fnmem, O_RDWR|O_CREAT, MM_CORE_FILEMODE)) == -1)
+ 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 (ftruncate(fdmem, mm_core_mapoffset+size) == -1)
FAIL(MM_ERR_CORE|MM_ERR_SYSTEM, "failed to truncate memory file");
@@ -303,13 +303,13 @@
#if defined(MM_SEMT_FLOCK)
unlink(fnsem);
- if ((fdsem = open(fnsem, O_RDWR|O_CREAT, MM_CORE_FILEMODE)) == -1)
+ if ((fdsem = open(fnsem, O_RDWR|O_CREAT|O_EXCL, MM_CORE_FILEMODE)) == -1)
FAIL(MM_ERR_CORE|MM_ERR_SYSTEM, "failed to open semaphore file");
#endif /* MM_SEMT_FLOCK */
#if defined(MM_SEMT_FCNTL)
unlink(fnsem);
- if ((fdsem = open(fnsem, O_RDWR|O_CREAT, MM_CORE_FILEMODE)) == -1)
+ if ((fdsem = open(fnsem, O_RDWR|O_CREAT|O_EXCL, MM_CORE_FILEMODE)) == -1)
FAIL(MM_ERR_CORE|MM_ERR_SYSTEM, "failed to open semaphore file");
#endif /* MM_SEMT_FCNTL */
|