hfsprogs: Fix compilation with uClibc-ng
Replaced deprecated and unsupported valloc with posix_memalign. Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
parent
5e28ab3eff
commit
4639e208b3
2 changed files with 21 additions and 1 deletions
|
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=hfsprogs
|
PKG_NAME:=hfsprogs
|
||||||
PKG_VERSION:=332.25
|
PKG_VERSION:=332.25
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=2
|
||||||
|
|
||||||
PKG_LICENSE:=GPL-3.0+
|
PKG_LICENSE:=GPL-3.0+
|
||||||
PKG_LICENSE_FILES:=COPYING
|
PKG_LICENSE_FILES:=COPYING
|
||||||
|
|
20
utils/hfsprogs/patches/010-valloc-to-memalign.patch
Normal file
20
utils/hfsprogs/patches/010-valloc-to-memalign.patch
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
--- a/newfs_hfs.tproj/makehfs.c
|
||||||
|
+++ b/newfs_hfs.tproj/makehfs.c
|
||||||
|
@@ -376,7 +376,7 @@ make_hfsplus(const DriveInfo *driveInfo, hfsparams_t *defaults)
|
||||||
|
if ( (temp & 0x01FF) != 0 )
|
||||||
|
temp = (temp + kBytesPerSector) & 0xFFFFFE00;
|
||||||
|
|
||||||
|
- nodeBuffer = valloc((size_t)temp);
|
||||||
|
+ (void)posix_memalign(&nodeBuffer, sysconf(_SC_PAGESIZE), (size_t)temp);
|
||||||
|
if (nodeBuffer == NULL)
|
||||||
|
err(1, NULL);
|
||||||
|
|
||||||
|
@@ -1814,7 +1814,7 @@ ClearDisk(const DriveInfo *driveInfo, UInt64 startingSector, UInt32 numberOfSect
|
||||||
|
|
||||||
|
bufferSize = bufferSizeInSectors << kLog2SectorSize;
|
||||||
|
|
||||||
|
- tempBuffer = valloc((size_t)bufferSize);
|
||||||
|
+ (void)posix_memalign(&tempBuffer, sysconf(_SC_PAGESIZE), (size_t)bufferSize);
|
||||||
|
if (tempBuffer == NULL)
|
||||||
|
err(1, NULL);
|
||||||
|
|
Loading…
Reference in a new issue