Patchs from Jeff Garzik <jgarzik@mandrakesoft.com> to cleanup
authorEric Andersen <andersen@codepoet.org>
Fri, 9 Mar 2001 14:36:42 +0000 (14:36 -0000)
committerEric Andersen <andersen@codepoet.org>
Fri, 9 Mar 2001 14:36:42 +0000 (14:36 -0000)
warnings with glibc 2.2 and use always use xfopen
 -Erik

34 files changed:
cat.c
coreutils/cat.c
coreutils/df.c
coreutils/du.c
coreutils/head.c
coreutils/sort.c
coreutils/uname.c
coreutils/wc.c
dc.c
df.c
du.c
fbset.c
head.c
hostname.c
lsmod.c
miscutils/dc.c
miscutils/mktemp.c
miscutils/mt.c
mkfs_minix.c
mktemp.c
modutils/lsmod.c
mt.c
nc.c
networking/hostname.c
networking/nc.c
rdate.c
sort.c
swaponoff.c
uname.c
util-linux/fbset.c
util-linux/mkfs_minix.c
util-linux/rdate.c
util-linux/swaponoff.c
wc.c

diff --git a/cat.c b/cat.c
index 3554008f851a63c2b61db9f465708df2479f8b08..aa8528d6ae53849930b4f7488d75cff5dadf53ef 100644 (file)
--- a/cat.c
+++ b/cat.c
@@ -22,6 +22,7 @@
  */
 
 #include <stdlib.h>
+#include <string.h>
 #include "busybox.h"
 
 extern int cat_main(int argc, char **argv)
index 3554008f851a63c2b61db9f465708df2479f8b08..aa8528d6ae53849930b4f7488d75cff5dadf53ef 100644 (file)
@@ -22,6 +22,7 @@
  */
 
 #include <stdlib.h>
+#include <string.h>
 #include "busybox.h"
 
 extern int cat_main(int argc, char **argv)
index 485076f90e863fe827f52f6470d865513a162620..776fceb2801f8b9d3db8aab0bb628f11ae6704a0 100644 (file)
@@ -24,6 +24,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #include <mntent.h>
 #include <sys/vfs.h>
 #include <getopt.h>
index 17ecfdeacb070b0e0a62c8087e1144af229a9997..7cb888de86efc692c0c84697900d602a5840f6d9 100644 (file)
@@ -28,6 +28,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <getopt.h>
+#include <string.h>
 #include <errno.h>
 #include "busybox.h"
 #define BB_DECLARE_EXTERN
@@ -196,7 +197,7 @@ int du_main(int argc, char **argv)
        return status;
 }
 
-/* $Id: du.c,v 1.42 2001/03/07 17:42:07 markw Exp $ */
+/* $Id: du.c,v 1.43 2001/03/09 14:36:42 andersen Exp $ */
 /*
 Local Variables:
 c-file-style: "linux"
index c683ec78aaf715b1277457508f07ea6a6ab59a1e..fac9ec659b2165ad6001170972092236c82b02c6 100644 (file)
@@ -26,6 +26,7 @@
 #include <stdio.h>
 #include <getopt.h>
 #include <stdlib.h>
+#include <string.h>
 #include "busybox.h"
 
 int head(int len, FILE *fp)
index ed687221846f29b59b6f8c5b62e9b041b8f3019a..79e629c757bc397d7426c906266e2560ef3f412d 100644 (file)
@@ -22,6 +22,7 @@
  */
 
 #include <getopt.h>
+#include <string.h>
 #include <stdlib.h>
 #include "busybox.h"
 
index 4931ff1d8f55c43492014b31ec889552a8d650c0..f7e2291a8f8cc159201568da24bc96a8895d96c2 100644 (file)
@@ -33,6 +33,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #include <sys/types.h>
 #include <sys/utsname.h>
 
index f2d33d6f355f2c1155c273f5f2c360cf7b0a30eb..5472c30704e40e83dc882551c2610bde78471fa4 100644 (file)
@@ -22,6 +22,7 @@
 
 #include <stdio.h>
 #include <getopt.h>
+#include <string.h>
 #include <stdlib.h>
 #include "busybox.h"
 
diff --git a/dc.c b/dc.c
index a422139b1e4ebf1008c9dd6c906c9f6953e40002..8d7a92a2802f5c871f40a4cb65bafd22667d9abe 100644 (file)
--- a/dc.c
+++ b/dc.c
@@ -2,6 +2,7 @@
 #include <ctype.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #include <unistd.h>
 #include <math.h>
 #include "busybox.h"
diff --git a/df.c b/df.c
index 485076f90e863fe827f52f6470d865513a162620..776fceb2801f8b9d3db8aab0bb628f11ae6704a0 100644 (file)
--- a/df.c
+++ b/df.c
@@ -24,6 +24,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #include <mntent.h>
 #include <sys/vfs.h>
 #include <getopt.h>
diff --git a/du.c b/du.c
index 17ecfdeacb070b0e0a62c8087e1144af229a9997..7cb888de86efc692c0c84697900d602a5840f6d9 100644 (file)
--- a/du.c
+++ b/du.c
@@ -28,6 +28,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <getopt.h>
+#include <string.h>
 #include <errno.h>
 #include "busybox.h"
 #define BB_DECLARE_EXTERN
@@ -196,7 +197,7 @@ int du_main(int argc, char **argv)
        return status;
 }
 
-/* $Id: du.c,v 1.42 2001/03/07 17:42:07 markw Exp $ */
+/* $Id: du.c,v 1.43 2001/03/09 14:36:42 andersen Exp $ */
 /*
 Local Variables:
 c-file-style: "linux"
diff --git a/fbset.c b/fbset.c
index 72284a6c5eebab6e41a90b0f87c9856bf56149c3..be1e3c3f1d1579227e95d3133cda840c8677a6c9 100644 (file)
--- a/fbset.c
+++ b/fbset.c
@@ -198,8 +198,7 @@ static int readmode(struct fb_var_screeninfo *base, const char *fn,
        char buf[256];
        char *p = buf;
 
-       if ((f = fopen(fn, "r")) == NULL)
-               perror_msg_and_die("readmode(fopen)");
+       f = xfopen(fn, "r");
        while (!feof(f)) {
                fgets(buf, sizeof(buf), f);
                if ((p = strstr(buf, "mode ")) || (p = strstr(buf, "mode\t"))) {
diff --git a/head.c b/head.c
index c683ec78aaf715b1277457508f07ea6a6ab59a1e..fac9ec659b2165ad6001170972092236c82b02c6 100644 (file)
--- a/head.c
+++ b/head.c
@@ -26,6 +26,7 @@
 #include <stdio.h>
 #include <getopt.h>
 #include <stdlib.h>
+#include <string.h>
 #include "busybox.h"
 
 int head(int len, FILE *fp)
index e1486b3655a1b4508f315931607eff5ba200d989..8ea8fe10787789247a13bd0f354de3834ce669bd 100644 (file)
@@ -1,6 +1,6 @@
 /* vi: set sw=4 ts=4: */
 /*
- * $Id: hostname.c,v 1.24 2001/02/14 21:23:06 andersen Exp $
+ * $Id: hostname.c,v 1.25 2001/03/09 14:36:42 andersen Exp $
  * Mini hostname implementation for busybox
  *
  * Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
@@ -30,6 +30,7 @@
 #include <unistd.h>
 #include <string.h>
 #include <stdio.h>
+#include <stdlib.h>
 
 void do_sethostname(char *s, int isfile)
 {
diff --git a/lsmod.c b/lsmod.c
index a853db888fca20080020aacee82ed949a1a27135..8251705de62d6fc0bab6c494c6224166c8a3e033 100644 (file)
--- a/lsmod.c
+++ b/lsmod.c
@@ -27,6 +27,7 @@
 
 #include <stdlib.h>
 #include <stdio.h>
+#include <string.h>
 #include <stddef.h>
 #include <errno.h>
 #include <unistd.h>
index a422139b1e4ebf1008c9dd6c906c9f6953e40002..8d7a92a2802f5c871f40a4cb65bafd22667d9abe 100644 (file)
@@ -2,6 +2,7 @@
 #include <ctype.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #include <unistd.h>
 #include <math.h>
 #include "busybox.h"
index 31ab9e22816f31e72d99176b0b935decbd8c8a44..bc47d0af0fe922598c6805074fa8d7705a2c1fc9 100644 (file)
@@ -24,6 +24,7 @@
 
 #include <stdio.h>
 #include <errno.h>
+#include <string.h>
 #include <unistd.h>
 #include <stdlib.h>
 #include "busybox.h"
index 350d3ae5a629f887871c16708ceccfd1b92d6d03..250856f05c29e1ea21b4a470af95ee389cfa6182 100644 (file)
@@ -1,6 +1,7 @@
 /* vi: set sw=4 ts=4: */
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #include <sys/mtio.h>
 #include <sys/fcntl.h>
 #include "busybox.h"
index b666338dc1aee487381394f240c38f342d88bdfe..928a496744c624eb34c9fdd9e69c0d91f6ecb582 100644 (file)
@@ -683,10 +683,7 @@ char *filename;
        FILE *listfile;
        unsigned long blockno;
 
-       listfile = fopen(filename, "r");
-       if (listfile == (FILE *) NULL) {
-               error_msg_and_die("can't open file of bad blocks");
-       }
+       listfile = xfopen(filename, "r");
        while (!feof(listfile)) {
                fscanf(listfile, "%ld\n", &blockno);
                mark_zone(blockno);
index 31ab9e22816f31e72d99176b0b935decbd8c8a44..bc47d0af0fe922598c6805074fa8d7705a2c1fc9 100644 (file)
--- a/mktemp.c
+++ b/mktemp.c
@@ -24,6 +24,7 @@
 
 #include <stdio.h>
 #include <errno.h>
+#include <string.h>
 #include <unistd.h>
 #include <stdlib.h>
 #include "busybox.h"
index a853db888fca20080020aacee82ed949a1a27135..8251705de62d6fc0bab6c494c6224166c8a3e033 100644 (file)
@@ -27,6 +27,7 @@
 
 #include <stdlib.h>
 #include <stdio.h>
+#include <string.h>
 #include <stddef.h>
 #include <errno.h>
 #include <unistd.h>
diff --git a/mt.c b/mt.c
index 350d3ae5a629f887871c16708ceccfd1b92d6d03..250856f05c29e1ea21b4a470af95ee389cfa6182 100644 (file)
--- a/mt.c
+++ b/mt.c
@@ -1,6 +1,7 @@
 /* vi: set sw=4 ts=4: */
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #include <sys/mtio.h>
 #include <sys/fcntl.h>
 #include "busybox.h"
diff --git a/nc.c b/nc.c
index e40d4b459491fd307b6b456f14dcb05d44926509..72439dd85d72c9daa1947824adcc7477861b2810 100644 (file)
--- a/nc.c
+++ b/nc.c
@@ -28,6 +28,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #include <unistd.h>
 
 #include <sys/types.h>
index e1486b3655a1b4508f315931607eff5ba200d989..8ea8fe10787789247a13bd0f354de3834ce669bd 100644 (file)
@@ -1,6 +1,6 @@
 /* vi: set sw=4 ts=4: */
 /*
- * $Id: hostname.c,v 1.24 2001/02/14 21:23:06 andersen Exp $
+ * $Id: hostname.c,v 1.25 2001/03/09 14:36:42 andersen Exp $
  * Mini hostname implementation for busybox
  *
  * Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
@@ -30,6 +30,7 @@
 #include <unistd.h>
 #include <string.h>
 #include <stdio.h>
+#include <stdlib.h>
 
 void do_sethostname(char *s, int isfile)
 {
index e40d4b459491fd307b6b456f14dcb05d44926509..72439dd85d72c9daa1947824adcc7477861b2810 100644 (file)
@@ -28,6 +28,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #include <unistd.h>
 
 #include <sys/types.h>
diff --git a/rdate.c b/rdate.c
index a3ea3a85bf3204f8a8d35e810b12b1a0ce92d105..ed7121a75b829c3454c935dfa389c89b4a635a53 100644 (file)
--- a/rdate.c
+++ b/rdate.c
@@ -28,6 +28,8 @@
 #include <netdb.h>
 #include <stdio.h>
 #include <getopt.h>
+#include <string.h>
+#include <time.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include "busybox.h"
diff --git a/sort.c b/sort.c
index ed687221846f29b59b6f8c5b62e9b041b8f3019a..79e629c757bc397d7426c906266e2560ef3f412d 100644 (file)
--- a/sort.c
+++ b/sort.c
@@ -22,6 +22,7 @@
  */
 
 #include <getopt.h>
+#include <string.h>
 #include <stdlib.h>
 #include "busybox.h"
 
index 0613fa1e910cfa91f598f241a519dfd2aa14f6cc..9deb13a2828c3947f48cae9dc2d638709b7beaa5 100644 (file)
@@ -26,6 +26,7 @@
 #include <mntent.h>
 #include <dirent.h>
 #include <errno.h>
+#include <string.h>
 #include <stdlib.h>
 #include <sys/mount.h>
 #include <sys/syscall.h>
diff --git a/uname.c b/uname.c
index 4931ff1d8f55c43492014b31ec889552a8d650c0..f7e2291a8f8cc159201568da24bc96a8895d96c2 100644 (file)
--- a/uname.c
+++ b/uname.c
@@ -33,6 +33,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #include <sys/types.h>
 #include <sys/utsname.h>
 
index 72284a6c5eebab6e41a90b0f87c9856bf56149c3..be1e3c3f1d1579227e95d3133cda840c8677a6c9 100644 (file)
@@ -198,8 +198,7 @@ static int readmode(struct fb_var_screeninfo *base, const char *fn,
        char buf[256];
        char *p = buf;
 
-       if ((f = fopen(fn, "r")) == NULL)
-               perror_msg_and_die("readmode(fopen)");
+       f = xfopen(fn, "r");
        while (!feof(f)) {
                fgets(buf, sizeof(buf), f);
                if ((p = strstr(buf, "mode ")) || (p = strstr(buf, "mode\t"))) {
index b666338dc1aee487381394f240c38f342d88bdfe..928a496744c624eb34c9fdd9e69c0d91f6ecb582 100644 (file)
@@ -683,10 +683,7 @@ char *filename;
        FILE *listfile;
        unsigned long blockno;
 
-       listfile = fopen(filename, "r");
-       if (listfile == (FILE *) NULL) {
-               error_msg_and_die("can't open file of bad blocks");
-       }
+       listfile = xfopen(filename, "r");
        while (!feof(listfile)) {
                fscanf(listfile, "%ld\n", &blockno);
                mark_zone(blockno);
index a3ea3a85bf3204f8a8d35e810b12b1a0ce92d105..ed7121a75b829c3454c935dfa389c89b4a635a53 100644 (file)
@@ -28,6 +28,8 @@
 #include <netdb.h>
 #include <stdio.h>
 #include <getopt.h>
+#include <string.h>
+#include <time.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include "busybox.h"
index 0613fa1e910cfa91f598f241a519dfd2aa14f6cc..9deb13a2828c3947f48cae9dc2d638709b7beaa5 100644 (file)
@@ -26,6 +26,7 @@
 #include <mntent.h>
 #include <dirent.h>
 #include <errno.h>
+#include <string.h>
 #include <stdlib.h>
 #include <sys/mount.h>
 #include <sys/syscall.h>
diff --git a/wc.c b/wc.c
index f2d33d6f355f2c1155c273f5f2c360cf7b0a30eb..5472c30704e40e83dc882551c2610bde78471fa4 100644 (file)
--- a/wc.c
+++ b/wc.c
@@ -22,6 +22,7 @@
 
 #include <stdio.h>
 #include <getopt.h>
+#include <string.h>
 #include <stdlib.h>
 #include "busybox.h"