summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-fs/mac-fdisk/files/mac-fdisk-0.1-headers.patch')
-rw-r--r--sys-fs/mac-fdisk/files/mac-fdisk-0.1-headers.patch112
1 files changed, 112 insertions, 0 deletions
diff --git a/sys-fs/mac-fdisk/files/mac-fdisk-0.1-headers.patch b/sys-fs/mac-fdisk/files/mac-fdisk-0.1-headers.patch
new file mode 100644
index 000000000000..5ca1f6e42fb7
--- /dev/null
+++ b/sys-fs/mac-fdisk/files/mac-fdisk-0.1-headers.patch
@@ -0,0 +1,112 @@
+Include a lot more headers and remove a bunch of braindead __linux__ checks
+
+--- mac-fdisk-0.1/dump.c
++++ mac-fdisk-0.1/dump.c
+@@ -30,10 +30,8 @@
+ */
+
+ #include <stdio.h>
+-#ifndef __linux__
+ #include <stdlib.h>
+ #include <unistd.h>
+-#endif
+ #include <string.h>
+ #include <errno.h>
+ #include <fcntl.h>
+--- mac-fdisk-0.1/errors.c
++++ mac-fdisk-0.1/errors.c
+@@ -26,9 +26,7 @@
+ */
+
+ #include <stdio.h>
+-#ifndef __linux__
+ #include <stdlib.h>
+-#endif
+ #include <string.h>
+ #include <stdarg.h>
+
+@@ -115,8 +113,8 @@
+ va_end(ap);
+
+ #ifdef __linux__
+- if (value > 0 && value < sys_nerr) {
+- fprintf(stderr, " (%s)\n", sys_errlist[value]);
++ if (value > 0) {
++ fprintf(stderr, " (%s)\n", strerror(value));
+ } else {
+ fprintf(stderr, "\n");
+ }
+@@ -144,8 +142,8 @@
+ va_end(ap);
+
+ #ifdef __linux__
+- if (value > 0 && value < sys_nerr) {
+- fprintf(stderr, " (%s)\n", sys_errlist[value]);
++ if (value > 0) {
++ fprintf(stderr, " (%s)\n", strerror(value));
+ } else {
+ fprintf(stderr, "\n");
+ }
+--- mac-fdisk-0.1/fdisk.c
++++ mac-fdisk-0.1/fdisk.c
+@@ -62,6 +62,7 @@
+ #include <unistd.h>
+ #include <stdio.h>
+ #include <stdlib.h>
++#include <string.h>
+ #include <fcntl.h>
+ #include <ctype.h>
+ #include <setjmp.h>
+--- mac-fdisk-0.1/fdisklabel.c
++++ mac-fdisk-0.1/fdisklabel.c
+@@ -38,6 +38,7 @@
+ #include <unistd.h>
+ #include <stdio.h>
+ #include <stdlib.h>
++#include <string.h>
+ #include <fcntl.h>
+ #include <ctype.h>
+ #include <setjmp.h>
+--- mac-fdisk-0.1/io.c
++++ mac-fdisk-0.1/io.c
+@@ -26,9 +26,9 @@
+ */
+
+ #include <stdio.h>
+-#ifndef __linux__
+ #include <stdlib.h>
+ #include <fcntl.h>
++#ifndef __linux__
+ #include <SCSI.h>
+ #else
+ #ifdef __GLIBC__
+--- mac-fdisk-0.1/partition_map.c
++++ mac-fdisk-0.1/partition_map.c
+@@ -26,10 +26,9 @@
+ */
+
+ #include <stdio.h>
+-#ifndef __linux__
++#include <string.h>
+ #include <stdlib.h>
+ #include <unistd.h>
+-#endif
+ #include <errno.h>
+
+ #include <fcntl.h>
+--- mac-fdisk-0.1/pdisk.c
++++ mac-fdisk-0.1/pdisk.c
+@@ -32,10 +32,11 @@
+ #include <getopt.h>
+ #include <stddef.h>
+ #else
+-#include <stdlib.h>
+-#include <unistd.h>
+ #include <SIOUX.h>
+ #endif
++#include <stdlib.h>
++#include <unistd.h>
++#include <string.h>
+ #include <errno.h>
+
+ #ifdef __linux__