Fix compile error due to missing ENOMEM on some platforms
[fio.git] / helpers.c
index 987f5b683bb08c0014fb17eae1b1099b3754f722..21b991361c7545bb6b7d60cd563f0f4bc1312f10 100644 (file)
--- a/helpers.c
+++ b/helpers.c
@@ -1,12 +1,16 @@
 #include <malloc.h>
 #include <stdlib.h>
+#include <errno.h>
 
 #include "compiler/compiler.h"
 
 int __weak posix_memalign(void **ptr, size_t align, size_t size)
 {
        *ptr = memalign(align, size);
-       return *ptr == NULL;
+       if (*ptr)
+               return 0;
+
+       return ENOMEM;
 }
 
 int __weak posix_fallocate(int fd, off_t offset, off_t len)