aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKurt Jaeger <pi@FreeBSD.org>2019-02-26 22:28:52 +0000
committerKurt Jaeger <pi@FreeBSD.org>2019-02-26 22:28:52 +0000
commit83423db06ddb2cce185a4e56cbe830c8b78c01e1 (patch)
treee8fb5a9246c08f7663be67be6fe6642fd867fd1d
parent967d42cb829488c68490e071f81edee23e8cb35f (diff)
downloadports-83423db06ddb2cce185a4e56cbe830c8b78c01e1.tar.gz
ports-83423db06ddb2cce185a4e56cbe830c8b78c01e1.zip
Notes
-rw-r--r--devel/ElectricFence/files/patch-efence.c46
1 files changed, 36 insertions, 10 deletions
diff --git a/devel/ElectricFence/files/patch-efence.c b/devel/ElectricFence/files/patch-efence.c
index 5091d6f1415a..ab8685d6e52c 100644
--- a/devel/ElectricFence/files/patch-efence.c
+++ b/devel/ElectricFence/files/patch-efence.c
@@ -1,12 +1,38 @@
---- efence.c.orig Mon Jan 13 17:24:08 2003
-+++ efence.c Mon Jan 13 17:22:50 2003
-@@ -271,7 +271,9 @@
- char * string;
- Slot * slot;
+--- efence.c.orig 2019-02-26 17:53:52.941236000 +0100
++++ efence.c 2019-02-26 17:56:18.688752000 +0100
+@@ -38,6 +38,7 @@
+ # include <pthread.h>
+ # include <semaphore.h>
+ #endif
++#include <errno.h>
-+#if 0
- EF_Print(version);
-+#endif
+ #ifdef malloc
+ #undef malloc
+@@ -670,6 +671,27 @@
+ release();
- #ifdef USE_SEMAPHORE
- if (sem_init(&EF_sem, 0, 1) >= 0) {
+ return address;
++}
++
++extern C_LINKAGE int
++posix_memalign(void **memptr, size_t alignment, size_t userSize)
++{
++ /*
++ * Per standard, posix_memalign returns EINVAL when alignment
++ * is not a power of two or power of sizeof(void*). efence
++ * doesn't check the value of alignment in memalign, but then
++ * again, memalign was never specified very well, and on some
++ * systems odd alignments could indeed have been allowed.
++ */
++ if ((alignment & (alignment - 1))
++ || alignment % sizeof (void *))
++ return EINVAL;
++
++ void *ptr = memalign (alignment, userSize);
++ if (ptr == NULL)
++ return ENOMEM;
++ *memptr = ptr;
++ return 0;
+ }
+
+ /*