From: Jens Axboe Date: Mon, 23 Nov 2009 14:21:39 +0000 (+0100) Subject: Fix posix_memalign() return value in case of error X-Git-Tag: fio-1.36-rc1~11 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=7d289b2a318b3412ffbc33b0e3e4061bba922b90;hp=ed80ddf66943dc2654a92eb77b57c3d68613e9d6;ds=inline Fix posix_memalign() return value in case of error Signed-off-by: Jens Axboe --- diff --git a/helpers.c b/helpers.c index 987f5b68..ba5c654e 100644 --- a/helpers.c +++ b/helpers.c @@ -6,7 +6,10 @@ 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)