113 lines
2.0 KiB
Diff
113 lines
2.0 KiB
Diff
|
Include a lot more headers and remove a bunch of braindead __linux__ checks
|
||
|
|
||
|
--- dump.c
|
||
|
+++ 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>
|
||
|
--- errors.c
|
||
|
+++ 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");
|
||
|
}
|
||
|
--- fdisk.c
|
||
|
+++ 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>
|
||
|
--- fdisklabel.c
|
||
|
+++ 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>
|
||
|
--- io.c
|
||
|
+++ 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__
|
||
|
--- partition_map.c
|
||
|
+++ 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>
|
||
|
--- pdisk.c
|
||
|
+++ 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__
|