0
0
mirror of https://github.com/openwrt/packages.git synced 2025-01-31 03:41:44 +00:00
packages/utils/xfsprogs/patches/130-db-malloc-Use-posix_memalign-instead-of-deprecated-v.patch
Rosen Penev 05ce920e12 xfsprogs: update to 5.5
Reworked Makefile for consistency between packages.

Removed librt dependency. clock_gettime does not need it anymore.

Updated URL.

Add MAP_SYNC workaround as musl undefines MAP_SYNC for MIPS and PPC.

Refreshed patches and removed upstream ones

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-05-22 16:21:42 -07:00

27 lines
731 B
Diff

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(-)
--- a/db/malloc.c
+++ b/db/malloc.c
@@ -44,8 +44,7 @@ xmalloc(
{
void *ptr;
- ptr = valloc(size);
- if (ptr)
+ if(!posix_memalign(&ptr, sysconf(_SC_PAGESIZE), size))
return ptr;
badmalloc();
/* NOTREACHED */