recipes: tools/gptfdisk: Apply patches to fix build issues
[dragora.git] / patches / gptfdisk / popt-1.19.patch
blob39468d35cc31f91035ee72761103f45e9b5f672d
1 From 5d5e76d369a412bfb3d2cebb5fc0a7509cef878d Mon Sep 17 00:00:00 2001
2 From: Rod Smith <rodsmith@rodsbooks.com>
3 Date: Fri, 15 Apr 2022 18:10:14 -0400
4 Subject: [PATCH] Fix failure & crash of sgdisk when compiled with latest popt
5 (commit 740; presumably eventually release 1.19)
7 ---
8 gptcl.cc | 2 +-
9 support.h | 2 +-
10 2 files changed, 2 insertions(+), 2 deletions(-)
12 diff --git a/gptcl.cc b/gptcl.cc
13 index 34c9421..0d578eb 100644
14 --- a/gptcl.cc
15 +++ b/gptcl.cc
16 @@ -155,7 +155,7 @@ int GPTDataCL::DoOptions(int argc, char* argv[]) {
17 } // while
19 // Assume first non-option argument is the device filename....
20 - device = (char*) poptGetArg(poptCon);
21 + device = strdup((char*) poptGetArg(poptCon));
22 poptResetContext(poptCon);
24 if (device != NULL) {
25 diff --git a/support.h b/support.h
26 index 8ba9ad1..f91f1bc 100644
27 --- a/support.h
28 +++ b/support.h
29 @@ -8,7 +8,7 @@
30 #include <stdlib.h>
31 #include <string>
33 -#define GPTFDISK_VERSION "1.0.9"
34 +#define GPTFDISK_VERSION "1.0.9.1"
36 #if defined (__FreeBSD__) || defined (__FreeBSD_kernel__) || defined (__APPLE__)
37 // Darwin (Mac OS) & FreeBSD: disk IOCTLs are different, and there is no lseek64