aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Eric Andersen <andersen@codepoet.org>2001-03-09 14:36:42 +0000
committerGravatar Eric Andersen <andersen@codepoet.org>2001-03-09 14:36:42 +0000
commiteba8ed71f08f334bc94ac8eeedcd998fcdd05897 (patch)
treec7a2f4adfb3418ff5d970a4f01fe87df38e04dc9
parent9ba5bce06f71e610db752489b4f97e2af56c2577 (diff)
downloadbusybox-eba8ed71f08f334bc94ac8eeedcd998fcdd05897.tar.gz
busybox-eba8ed71f08f334bc94ac8eeedcd998fcdd05897.tar.bz2
Patchs from Jeff Garzik <jgarzik@mandrakesoft.com> to cleanup
warnings with glibc 2.2 and use always use xfopen -Erik
-rw-r--r--cat.c1
-rw-r--r--coreutils/cat.c1
-rw-r--r--coreutils/df.c1
-rw-r--r--coreutils/du.c3
-rw-r--r--coreutils/head.c1
-rw-r--r--coreutils/sort.c1
-rw-r--r--coreutils/uname.c1
-rw-r--r--coreutils/wc.c1
-rw-r--r--dc.c1
-rw-r--r--df.c1
-rw-r--r--du.c3
-rw-r--r--fbset.c3
-rw-r--r--head.c1
-rw-r--r--hostname.c3
-rw-r--r--lsmod.c1
-rw-r--r--miscutils/dc.c1
-rw-r--r--miscutils/mktemp.c1
-rw-r--r--miscutils/mt.c1
-rw-r--r--mkfs_minix.c5
-rw-r--r--mktemp.c1
-rw-r--r--modutils/lsmod.c1
-rw-r--r--mt.c1
-rw-r--r--nc.c1
-rw-r--r--networking/hostname.c3
-rw-r--r--networking/nc.c1
-rw-r--r--rdate.c2
-rw-r--r--sort.c1
-rw-r--r--swaponoff.c1
-rw-r--r--uname.c1
-rw-r--r--util-linux/fbset.c3
-rw-r--r--util-linux/mkfs_minix.c5
-rw-r--r--util-linux/rdate.c2
-rw-r--r--util-linux/swaponoff.c1
-rw-r--r--wc.c1
34 files changed, 40 insertions, 16 deletions
diff --git a/cat.c b/cat.c
index 3554008f8..aa8528d6a 100644
--- 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)
diff --git a/coreutils/cat.c b/coreutils/cat.c
index 3554008f8..aa8528d6a 100644
--- a/coreutils/cat.c
+++ b/coreutils/cat.c
@@ -22,6 +22,7 @@
*/
#include <stdlib.h>
+#include <string.h>
#include "busybox.h"
extern int cat_main(int argc, char **argv)
diff --git a/coreutils/df.c b/coreutils/df.c
index 485076f90..776fceb28 100644
--- a/coreutils/df.c
+++ b/coreutils/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/coreutils/du.c b/coreutils/du.c
index 17ecfdeac..7cb888de8 100644
--- a/coreutils/du.c
+++ b/coreutils/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/coreutils/head.c b/coreutils/head.c
index c683ec78a..fac9ec659 100644
--- a/coreutils/head.c
+++ b/coreutils/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)
diff --git a/coreutils/sort.c b/coreutils/sort.c
index ed6872218..79e629c75 100644
--- a/coreutils/sort.c
+++ b/coreutils/sort.c
@@ -22,6 +22,7 @@
*/
#include <getopt.h>
+#include <string.h>
#include <stdlib.h>
#include "busybox.h"
diff --git a/coreutils/uname.c b/coreutils/uname.c
index 4931ff1d8..f7e2291a8 100644
--- a/coreutils/uname.c
+++ b/coreutils/uname.c
@@ -33,6 +33,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <sys/types.h>
#include <sys/utsname.h>
diff --git a/coreutils/wc.c b/coreutils/wc.c
index f2d33d6f3..5472c3070 100644
--- a/coreutils/wc.c
+++ b/coreutils/wc.c
@@ -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 a422139b1..8d7a92a28 100644
--- 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 485076f90..776fceb28 100644
--- 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 17ecfdeac..7cb888de8 100644
--- 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 72284a6c5..be1e3c3f1 100644
--- 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 c683ec78a..fac9ec659 100644
--- 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)
diff --git a/hostname.c b/hostname.c
index e1486b365..8ea8fe107 100644
--- a/hostname.c
+++ b/hostname.c
@@ -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 a853db888..8251705de 100644
--- 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>
diff --git a/miscutils/dc.c b/miscutils/dc.c
index a422139b1..8d7a92a28 100644
--- a/miscutils/dc.c
+++ b/miscutils/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/miscutils/mktemp.c b/miscutils/mktemp.c
index 31ab9e228..bc47d0af0 100644
--- a/miscutils/mktemp.c
+++ b/miscutils/mktemp.c
@@ -24,6 +24,7 @@
#include <stdio.h>
#include <errno.h>
+#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include "busybox.h"
diff --git a/miscutils/mt.c b/miscutils/mt.c
index 350d3ae5a..250856f05 100644
--- a/miscutils/mt.c
+++ b/miscutils/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/mkfs_minix.c b/mkfs_minix.c
index b666338dc..928a49674 100644
--- a/mkfs_minix.c
+++ b/mkfs_minix.c
@@ -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);
diff --git a/mktemp.c b/mktemp.c
index 31ab9e228..bc47d0af0 100644
--- 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"
diff --git a/modutils/lsmod.c b/modutils/lsmod.c
index a853db888..8251705de 100644
--- a/modutils/lsmod.c
+++ b/modutils/lsmod.c
@@ -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 350d3ae5a..250856f05 100644
--- 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 e40d4b459..72439dd85 100644
--- 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>
diff --git a/networking/hostname.c b/networking/hostname.c
index e1486b365..8ea8fe107 100644
--- a/networking/hostname.c
+++ b/networking/hostname.c
@@ -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/networking/nc.c b/networking/nc.c
index e40d4b459..72439dd85 100644
--- a/networking/nc.c
+++ b/networking/nc.c
@@ -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 a3ea3a85b..ed7121a75 100644
--- 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 ed6872218..79e629c75 100644
--- a/sort.c
+++ b/sort.c
@@ -22,6 +22,7 @@
*/
#include <getopt.h>
+#include <string.h>
#include <stdlib.h>
#include "busybox.h"
diff --git a/swaponoff.c b/swaponoff.c
index 0613fa1e9..9deb13a28 100644
--- a/swaponoff.c
+++ b/swaponoff.c
@@ -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 4931ff1d8..f7e2291a8 100644
--- 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>
diff --git a/util-linux/fbset.c b/util-linux/fbset.c
index 72284a6c5..be1e3c3f1 100644
--- a/util-linux/fbset.c
+++ b/util-linux/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/util-linux/mkfs_minix.c b/util-linux/mkfs_minix.c
index b666338dc..928a49674 100644
--- a/util-linux/mkfs_minix.c
+++ b/util-linux/mkfs_minix.c
@@ -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);
diff --git a/util-linux/rdate.c b/util-linux/rdate.c
index a3ea3a85b..ed7121a75 100644
--- a/util-linux/rdate.c
+++ b/util-linux/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/util-linux/swaponoff.c b/util-linux/swaponoff.c
index 0613fa1e9..9deb13a28 100644
--- a/util-linux/swaponoff.c
+++ b/util-linux/swaponoff.c
@@ -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 f2d33d6f3..5472c3070 100644
--- 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"