diff options
author | Rosen Penev <rosenp@gmail.com> | 2019-05-06 14:57:18 -0700 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2019-05-11 23:10:10 +0200 |
commit | e49b6bb61828b8b903db0ef48113b4065a215c63 (patch) | |
tree | b871e2460fd51d95b2dc1d90e8750ddf265a1cfd /package/utils/xfsprogs/patches | |
parent | 3bc8ed91d47bc2513d8f3004148985e2b7c33377 (diff) | |
download | upstream-e49b6bb61828b8b903db0ef48113b4065a215c63.tar.gz upstream-e49b6bb61828b8b903db0ef48113b4065a215c63.tar.bz2 upstream-e49b6bb61828b8b903db0ef48113b4065a215c63.zip |
xfsprogs: Replace valloc with posix_memalign
Fixes compilation under uClibc-ng.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Diffstat (limited to 'package/utils/xfsprogs/patches')
-rw-r--r-- | package/utils/xfsprogs/patches/130-db-malloc-Use-posix_memalign-instead-of-deprecated-v.patch | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/package/utils/xfsprogs/patches/130-db-malloc-Use-posix_memalign-instead-of-deprecated-v.patch b/package/utils/xfsprogs/patches/130-db-malloc-Use-posix_memalign-instead-of-deprecated-v.patch new file mode 100644 index 0000000000..7bf1c77a40 --- /dev/null +++ b/package/utils/xfsprogs/patches/130-db-malloc-Use-posix_memalign-instead-of-deprecated-v.patch @@ -0,0 +1,31 @@ +From 930f9aa8f08759fa739dd6e615ba8b3a1890008d Mon Sep 17 00:00:00 2001 +From: Rosen Penev <rosenp@gmail.com> +Date: Mon, 6 May 2019 13:56:13 -0700 +Subject: [PATCH] db/malloc: Use posix_memalign instead of deprecated valloc + +valloc is not available with uClibc-ng as well as being deprecated, which +causes compilation errors. aligned_alloc is not available before C11 so +used posix_memalign.' + +Signed-off-by: Rosen Penev <rosenp@gmail.com> +--- + db/malloc.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/db/malloc.c b/db/malloc.c +index 77b3e022..38fe0b05 100644 +--- a/db/malloc.c ++++ b/db/malloc.c +@@ -56,8 +56,7 @@ xmalloc( + { + void *ptr; + +- ptr = valloc(size); +- if (ptr) ++ if(!posix_memalign(&ptr, sysconf(_SC_PAGESIZE), size)) + return ptr; + badmalloc(); + /* NOTREACHED */ +-- +2.17.1 + |