summaryrefslogtreecommitdiff
path: root/www/php4-apc/patches
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2001-10-29 19:33:49 +0000
committerjlam <jlam@pkgsrc.org>2001-10-29 19:33:49 +0000
commit573f745fb11d3833caade95e6b478180f3e70f34 (patch)
treeb2c55a78bc5df9b2f4d047d3cea7840b858116ef /www/php4-apc/patches
parentb3dec5f5445ff427ef56c21dc156f9a7f8545f26 (diff)
downloadpkgsrc-573f745fb11d3833caade95e6b478180f3e70f34.tar.gz
Some NetBSD releases don't have SHM_{R,W} so use the S_I{R,W}{USR,GRP,OTH}
flags instead.
Diffstat (limited to 'www/php4-apc/patches')
-rw-r--r--www/php4-apc/patches/patch-ad31
1 files changed, 31 insertions, 0 deletions
diff --git a/www/php4-apc/patches/patch-ad b/www/php4-apc/patches/patch-ad
new file mode 100644
index 00000000000..29582fda2ea
--- /dev/null
+++ b/www/php4-apc/patches/patch-ad
@@ -0,0 +1,31 @@
+$NetBSD: patch-ad,v 1.1 2001/10/29 19:33:50 jlam Exp $
+
+--- apc_shm.c.orig Sat Mar 24 17:15:50 2001
++++ apc_shm.c
+@@ -22,12 +22,17 @@
+ #include <errno.h>
+ #include <string.h>
+
++#if defined(__NetBSD__)
++#define IPC_PERMS ((S_IRUSR|S_IWUSR) | (S_IRGRP|S_IWGRP) | (S_IROTH|S_IWOTH))
++#else
+ #ifndef SHM_R
+ # define SHM_R 0444 /* read permission */
+ #endif
+ #ifndef SHM_A
+ # define SHM_A 0222 /* write permission */
+ #endif
++#define IPC_PERMS (SHM_R|SHM_A)
++#endif
+
+ /* apc_shm_create: create a shared memory segment of given size */
+ int apc_shm_create(const char* pathname, int proj, int size)
+@@ -44,7 +49,7 @@
+ }
+ }
+
+- oflag = IPC_CREAT | SHM_R | SHM_A;
++ oflag = IPC_CREAT | IPC_PERMS;
+ if ((shmid = shmget(key, size, oflag)) < 0) {
+ apc_eprint("apc_shmcreate: shmget(%d, %d,%d) failed: %s", key, size, oflag, strerror(errno));
+ }