summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2010-06-14 09:53:48 +0200
committerGerd Hoffmann <kraxel@redhat.com>2010-06-24 17:25:10 +0200
commitdaab1935d13e51044d025f1199bcc1274e9a0ebe (patch)
tree6b6ccee0bfff80eef594afaad8bef2b58c58a31c
parent2bb9bf64e5d3b8f5fc2d6651412894fd66401b97 (diff)
[ElectricFence] use memalign instead of posix_memalign
-rw-r--r--osdep.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/osdep.c b/osdep.c
index abbc8a238..adb9737d5 100644
--- a/osdep.c
+++ b/osdep.c
@@ -100,7 +100,12 @@ void *qemu_memalign(size_t alignment, size_t size)
#if defined(_POSIX_C_SOURCE) && !defined(__sun__)
int ret;
void *ptr;
+#if 0
ret = posix_memalign(&ptr, alignment, size);
+#else
+ ptr = memalign(alignment, size);
+ ret = (ptr == NULL) ? -1 : 0;
+#endif
if (ret != 0) {
fprintf(stderr, "Failed to allocate %zu B: %s\n",
size, strerror(ret));