summaryrefslogtreecommitdiff
path: root/helpers.c
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2009-11-23 15:21:39 +0100
committerJens Axboe <jens.axboe@oracle.com>2009-11-23 15:21:39 +0100
commit7d289b2a318b3412ffbc33b0e3e4061bba922b90 (patch)
tree8c0d6352d357198f09cf122893207b7fdbdc6edc /helpers.c
parented80ddf66943dc2654a92eb77b57c3d68613e9d6 (diff)
downloadfio-7d289b2a318b3412ffbc33b0e3e4061bba922b90.tar.gz
fio-7d289b2a318b3412ffbc33b0e3e4061bba922b90.tar.bz2
Fix posix_memalign() return value in case of error
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'helpers.c')
-rw-r--r--helpers.c5
1 files changed, 4 insertions, 1 deletions
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)