summaryrefslogtreecommitdiff
path: root/libgcompat
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-05-08 20:20:21 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-05-08 20:20:47 -0500
commitee849d022bea6bcf7fa2f7747b993034b16096fa (patch)
treeb1f661666796cc6579520b4c35bc592aac2dc8ab /libgcompat
parent8d59ff51c5d05ece395da3df13dd06821f9154bf (diff)
downloadgcompat-ee849d022bea6bcf7fa2f7747b993034b16096fa.tar.gz
gcompat-ee849d022bea6bcf7fa2f7747b993034b16096fa.tar.bz2
gcompat-ee849d022bea6bcf7fa2f7747b993034b16096fa.tar.xz
gcompat-ee849d022bea6bcf7fa2f7747b993034b16096fa.zip
malloc: use posix_memalign instead of deprecated memalign
Diffstat (limited to 'libgcompat')
-rw-r--r--libgcompat/malloc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libgcompat/malloc.c b/libgcompat/malloc.c
index 6c27f35..3f54a06 100644
--- a/libgcompat/malloc.c
+++ b/libgcompat/malloc.c
@@ -64,7 +64,10 @@ alias(__libc_malloc, __malloc);
void *__libc_memalign(size_t align, size_t len)
{
- return memalign(align, len);
+ void *result;
+ if (posix_memalign(&result, align, len) != 0)
+ return NULL;
+ return result;
}
alias(__libc_memalign, __memalign);