aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Postnikov <apostnikov@gmail.com>2023-10-22 02:13:43 +0200
committerAndy Postnikov <apostnikov@gmail.com>2023-10-22 02:13:43 +0200
commitda7214299520211703921fc81389045fea91feb7 (patch)
treebbe52ab3600bdacdb9d3ac5de353acba6e0103a5
parent5facb16acf3dc479808a416f1a5e8961aca2b5e5 (diff)
main/gptfdis: fix lfs64
-rw-r--r--main/gptfdisk/APKBUILD4
-rw-r--r--main/gptfdisk/fix-musl.patch58
2 files changed, 61 insertions, 1 deletions
diff --git a/main/gptfdisk/APKBUILD b/main/gptfdisk/APKBUILD
index cd0829932c5..4bf47942892 100644
--- a/main/gptfdisk/APKBUILD
+++ b/main/gptfdisk/APKBUILD
@@ -1,7 +1,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=gptfdisk
pkgver=1.0.9
-pkgrel=3
+pkgrel=4
pkgdesc="Text-mode partitioning tool that works on Globally Unique Identifier (GUID) Partition Table (GPT) disks"
arch="all"
url="https://www.rodsbooks.com/gdisk"
@@ -13,6 +13,7 @@ source="https://downloads.sourceforge.net/project/gptfdisk/gptfdisk/$pkgver/gptf
0001-Fix-failure-crash-of-sgdisk-when-compiled-with-lates.patch
0002-Updated-guid.cc-to-deal-with-minor-change-in-libuuid.patch
0003-Fix-NULL-dereference-when-duplicating-string-argumen.patch
+ fix-musl.patch
"
# secfixes:
# 1.0.6-r0:
@@ -47,4 +48,5 @@ c2489ac7e196cb53b9fdb18d0e421571eca43c366de8922c5c7f550aadf192558e7af69b181c3074
ebd680343cd7f559503156984f056f4b49cc3581c8c7f623c66c10bb79e1dd7ee9e217cbd0479ebe3b7bce3b34b85428bc3525aa354b76789e9bcbaf1000a889 0001-Fix-failure-crash-of-sgdisk-when-compiled-with-lates.patch
fd2747714f854a2abaa5cbd113a9bf9eea3d8ee6c46e47dbe3246c9d3bebb621a2a7bc623827f6f44870133eb09b5b991ea73d03755fa0e2b9d73c5cea821f33 0002-Updated-guid.cc-to-deal-with-minor-change-in-libuuid.patch
f1d3b1d43490665dbe2b024027b12803ec73698dc232335fd87813ffb940202032c8f47c3410190a00d16382a2ceb35effc1f825ca87f6a0cd3dad564bb751af 0003-Fix-NULL-dereference-when-duplicating-string-argumen.patch
+c85306ad9902d4c4f685c8fa5f6f4e1976d3036a4fc747cbc68403fa811a177a0d6ce29575c4d2dc03ccf9bcc44167dd5830eb8f548d9d55d2b6579ed1b4ffab fix-musl.patch
"
diff --git a/main/gptfdisk/fix-musl.patch b/main/gptfdisk/fix-musl.patch
new file mode 100644
index 00000000000..69c26f025b0
--- /dev/null
+++ b/main/gptfdisk/fix-musl.patch
@@ -0,0 +1,58 @@
+--- a/diskio-unix.cc
++++ b/diskio-unix.cc
+@@ -52,7 +52,7 @@
+ // work.
+ int DiskIO::OpenForRead(void) {
+ int shouldOpen = 1;
+- struct stat64 st;
++ struct stat st;
+
+ if (isOpen) { // file is already open
+ if (openForWrite) {
+@@ -78,7 +78,7 @@
+ } else {
+ isOpen = 0;
+ openForWrite = 0;
+- if (fstat64(fd, &st) == 0) {
++ if (fstat(fd, &st) == 0) {
+ if (S_ISDIR(st.st_mode))
+ cerr << "The specified path is a directory!\n";
+ #if !(defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) \
+@@ -311,7 +311,7 @@
+ // Note that seeking beyond the end of the file is NOT detected as a failure!
+ int DiskIO::Seek(uint64_t sector) {
+ int retval = 1;
+- off64_t seekTo, sought;
++ off_t seekTo, sought;
+
+ // If disk isn't open, try to open it....
+ if (!isOpen) {
+@@ -320,7 +320,7 @@
+
+ if (isOpen) {
+ seekTo = sector * (uint64_t) GetBlockSize();
+- sought = lseek64(fd, seekTo, SEEK_SET);
++ sought = lseek(fd, seekTo, SEEK_SET);
+ if (sought != seekTo) {
+ retval = 0;
+ } // if
+@@ -428,8 +428,8 @@
+ // return correct values for disk image files.
+ uint64_t DiskIO::DiskSize(int *err) {
+ uint64_t sectors = 0; // size in sectors
+- off64_t bytes = 0; // size in bytes
+- struct stat64 st;
++ off_t bytes = 0; // size in bytes
++ struct stat st;
+ int platformFound = 0;
+ #ifdef __sun__
+ struct dk_minfo minfo;
+@@ -488,7 +488,7 @@
+ // file (a QEMU image, dd backup, or what have you) and see what
+ // fstat() gives us....
+ if ((sectors == 0) || (*err == -1)) {
+- if (fstat64(fd, &st) == 0) {
++ if (fstat(fd, &st) == 0) {
+ bytes = st.st_size;
+ if ((bytes % UINT64_C(512)) != 0)
+ cerr << "Warning: File size is not a multiple of 512 bytes!"