summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2010-06-14 09:53:48 +0200
committerGerd Hoffmann <kraxel@redhat.com>2010-08-04 17:05:44 +0200
commit1b4ac7632a8337526555b91a9148ebfa5928c88a (patch)
treebe7127458a7b33d02e66d275fa10125dd4a5d3d1
parentda17e174fdcb0ca4e838e2664e7cc41376c8adb0 (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 dbf872aea..14323b7ee 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));