Author: tpot
Date: 2004-12-19 00:11:18 +0000 (Sun, 19 Dec 2004)
New Revision: 4266

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=4266

Log:
Use sys/types.h constants for permissions in shmget() call.  Bugzilla
#2150 filed by lukem.  (Shared memory is only used in smbtorture now).

Modified:
   trunk/source/include/includes.h
   trunk/source/profile/profile.c
   trunk/source/torture/torture.c


Changeset:
Modified: trunk/source/include/includes.h
===================================================================
--- trunk/source/include/includes.h     2004-12-19 00:09:22 UTC (rev 4265)
+++ trunk/source/include/includes.h     2004-12-19 00:11:18 UTC (rev 4266)
@@ -1209,15 +1209,6 @@
 #define LOG_DEBUG       7       /* debug-level messages */
 #endif
 
-/* NetBSD doesn't have these */
-#ifndef SHM_R
-#define SHM_R 0400
-#endif
-
-#ifndef SHM_W
-#define SHM_W 0200
-#endif
-
 #if HAVE_KERNEL_SHARE_MODES
 #ifndef LOCK_MAND 
 #define LOCK_MAND      32      /* This is a mandatory flock */

Modified: trunk/source/profile/profile.c
===================================================================
--- trunk/source/profile/profile.c      2004-12-19 00:09:22 UTC (rev 4265)
+++ trunk/source/profile/profile.c      2004-12-19 00:11:18 UTC (rev 4266)
@@ -22,7 +22,7 @@
 #include "includes.h"
 
 #ifdef WITH_PROFILE
-#define IPC_PERMS ((SHM_R | SHM_W) | (SHM_R>>3) | (SHM_R>>6))
+#define IPC_PERMS ((S_IRUSR | S_IWUSR) | S_IRGRP | S_IROTH)
 #endif /* WITH_PROFILE */
 
 #ifdef WITH_PROFILE

Modified: trunk/source/torture/torture.c
===================================================================
--- trunk/source/torture/torture.c      2004-12-19 00:09:22 UTC (rev 4265)
+++ trunk/source/torture/torture.c      2004-12-19 00:11:18 UTC (rev 4266)
@@ -70,7 +70,7 @@
        int shmid;
        void *ret;
 
-       shmid = shmget(IPC_PRIVATE, size, SHM_R | SHM_W);
+       shmid = shmget(IPC_PRIVATE, size, S_IRUSR | S_IWUSR);
        if (shmid == -1) {
                printf("can't get shared memory\n");
                exit(1);

Reply via email to