diff options
author | Kota Tsuyuzaki <tsuyuzaki.kota@lab.ntt.co.jp> | 2016-07-11 23:14:36 -0700 |
---|---|---|
committer | Kota Tsuyuzaki <tsuyuzaki.kota@lab.ntt.co.jp> | 2016-07-12 07:12:30 -0700 |
commit | bdc8503bb2e24d7f70f13503dc440d8f9276268e (patch) | |
tree | e779b153b0560e549e65785dc7cac8f3b839f8df /src | |
parent | 4a71b1d1a0add323ac98c65383e878308927b62c (diff) | |
download | liberasurecode-bdc8503bb2e24d7f70f13503dc440d8f9276268e.tar.gz |
Fix posix_memalign handling
Docs[1] says posix_memalign will return non-zero value if it failed
but currently it checked only if it's negative (or not) so that probably
it can triggers something wrong (e.g. core dumped) if something like ENOTMEM
returned.
Change-Id: I0b8883ea60a904d4dc0efef94a33946a44ecfe01
1: http://pubs.opengroup.org/onlinepubs/009695399/functions/posix_memalign.html
Diffstat (limited to 'src')
-rw-r--r-- | src/erasurecode_helpers.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/erasurecode_helpers.c b/src/erasurecode_helpers.c index 5068b27..40db93c 100644 --- a/src/erasurecode_helpers.c +++ b/src/erasurecode_helpers.c @@ -65,7 +65,7 @@ void *get_aligned_buffer16(int size) * Ensure all memory is aligned to 16-byte boundaries * to support 128-bit operations */ - if (posix_memalign(&buf, 16, size) < 0) { + if (posix_memalign(&buf, 16, size) != 0) { return NULL; } |