From eba8ed71f08f334bc94ac8eeedcd998fcdd05897 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Fri, 9 Mar 2001 14:36:42 +0000 Subject: Patchs from Jeff Garzik to cleanup warnings with glibc 2.2 and use always use xfopen -Erik --- cat.c | 1 + coreutils/cat.c | 1 + coreutils/df.c | 1 + coreutils/du.c | 3 ++- coreutils/head.c | 1 + coreutils/sort.c | 1 + coreutils/uname.c | 1 + coreutils/wc.c | 1 + dc.c | 1 + df.c | 1 + du.c | 3 ++- fbset.c | 3 +-- head.c | 1 + hostname.c | 3 ++- lsmod.c | 1 + miscutils/dc.c | 1 + miscutils/mktemp.c | 1 + miscutils/mt.c | 1 + mkfs_minix.c | 5 +---- mktemp.c | 1 + modutils/lsmod.c | 1 + mt.c | 1 + nc.c | 1 + networking/hostname.c | 3 ++- networking/nc.c | 1 + rdate.c | 2 ++ sort.c | 1 + swaponoff.c | 1 + uname.c | 1 + util-linux/fbset.c | 3 +-- util-linux/mkfs_minix.c | 5 +---- util-linux/rdate.c | 2 ++ util-linux/swaponoff.c | 1 + wc.c | 1 + 34 files changed, 40 insertions(+), 16 deletions(-) diff --git a/cat.c b/cat.c index 3554008..aa8528d 100644 --- a/cat.c +++ b/cat.c @@ -22,6 +22,7 @@ */ #include +#include #include "busybox.h" extern int cat_main(int argc, char **argv) diff --git a/coreutils/cat.c b/coreutils/cat.c index 3554008..aa8528d 100644 --- a/coreutils/cat.c +++ b/coreutils/cat.c @@ -22,6 +22,7 @@ */ #include +#include #include "busybox.h" extern int cat_main(int argc, char **argv) diff --git a/coreutils/df.c b/coreutils/df.c index 485076f..776fceb 100644 --- a/coreutils/df.c +++ b/coreutils/df.c @@ -24,6 +24,7 @@ #include #include +#include #include #include #include diff --git a/coreutils/du.c b/coreutils/du.c index 17ecfde..7cb888d 100644 --- a/coreutils/du.c +++ b/coreutils/du.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #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 c683ec7..fac9ec6 100644 --- a/coreutils/head.c +++ b/coreutils/head.c @@ -26,6 +26,7 @@ #include #include #include +#include #include "busybox.h" int head(int len, FILE *fp) diff --git a/coreutils/sort.c b/coreutils/sort.c index ed68722..79e629c 100644 --- a/coreutils/sort.c +++ b/coreutils/sort.c @@ -22,6 +22,7 @@ */ #include +#include #include #include "busybox.h" diff --git a/coreutils/uname.c b/coreutils/uname.c index 4931ff1..f7e2291 100644 --- a/coreutils/uname.c +++ b/coreutils/uname.c @@ -33,6 +33,7 @@ #include #include +#include #include #include diff --git a/coreutils/wc.c b/coreutils/wc.c index f2d33d6..5472c30 100644 --- a/coreutils/wc.c +++ b/coreutils/wc.c @@ -22,6 +22,7 @@ #include #include +#include #include #include "busybox.h" diff --git a/dc.c b/dc.c index a422139..8d7a92a 100644 --- a/dc.c +++ b/dc.c @@ -2,6 +2,7 @@ #include #include #include +#include #include #include #include "busybox.h" diff --git a/df.c b/df.c index 485076f..776fceb 100644 --- a/df.c +++ b/df.c @@ -24,6 +24,7 @@ #include #include +#include #include #include #include diff --git a/du.c b/du.c index 17ecfde..7cb888d 100644 --- a/du.c +++ b/du.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #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 72284a6..be1e3c3 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 c683ec7..fac9ec6 100644 --- a/head.c +++ b/head.c @@ -26,6 +26,7 @@ #include #include #include +#include #include "busybox.h" int head(int len, FILE *fp) diff --git a/hostname.c b/hostname.c index e1486b3..8ea8fe1 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 @@ -30,6 +30,7 @@ #include #include #include +#include void do_sethostname(char *s, int isfile) { diff --git a/lsmod.c b/lsmod.c index a853db8..8251705 100644 --- a/lsmod.c +++ b/lsmod.c @@ -27,6 +27,7 @@ #include #include +#include #include #include #include diff --git a/miscutils/dc.c b/miscutils/dc.c index a422139..8d7a92a 100644 --- a/miscutils/dc.c +++ b/miscutils/dc.c @@ -2,6 +2,7 @@ #include #include #include +#include #include #include #include "busybox.h" diff --git a/miscutils/mktemp.c b/miscutils/mktemp.c index 31ab9e2..bc47d0a 100644 --- a/miscutils/mktemp.c +++ b/miscutils/mktemp.c @@ -24,6 +24,7 @@ #include #include +#include #include #include #include "busybox.h" diff --git a/miscutils/mt.c b/miscutils/mt.c index 350d3ae..250856f 100644 --- a/miscutils/mt.c +++ b/miscutils/mt.c @@ -1,6 +1,7 @@ /* vi: set sw=4 ts=4: */ #include #include +#include #include #include #include "busybox.h" diff --git a/mkfs_minix.c b/mkfs_minix.c index b666338..928a496 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 31ab9e2..bc47d0a 100644 --- a/mktemp.c +++ b/mktemp.c @@ -24,6 +24,7 @@ #include #include +#include #include #include #include "busybox.h" diff --git a/modutils/lsmod.c b/modutils/lsmod.c index a853db8..8251705 100644 --- a/modutils/lsmod.c +++ b/modutils/lsmod.c @@ -27,6 +27,7 @@ #include #include +#include #include #include #include diff --git a/mt.c b/mt.c index 350d3ae..250856f 100644 --- a/mt.c +++ b/mt.c @@ -1,6 +1,7 @@ /* vi: set sw=4 ts=4: */ #include #include +#include #include #include #include "busybox.h" diff --git a/nc.c b/nc.c index e40d4b4..72439dd 100644 --- a/nc.c +++ b/nc.c @@ -28,6 +28,7 @@ #include #include +#include #include #include diff --git a/networking/hostname.c b/networking/hostname.c index e1486b3..8ea8fe1 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 @@ -30,6 +30,7 @@ #include #include #include +#include void do_sethostname(char *s, int isfile) { diff --git a/networking/nc.c b/networking/nc.c index e40d4b4..72439dd 100644 --- a/networking/nc.c +++ b/networking/nc.c @@ -28,6 +28,7 @@ #include #include +#include #include #include diff --git a/rdate.c b/rdate.c index a3ea3a8..ed7121a 100644 --- a/rdate.c +++ b/rdate.c @@ -28,6 +28,8 @@ #include #include #include +#include +#include #include #include #include "busybox.h" diff --git a/sort.c b/sort.c index ed68722..79e629c 100644 --- a/sort.c +++ b/sort.c @@ -22,6 +22,7 @@ */ #include +#include #include #include "busybox.h" diff --git a/swaponoff.c b/swaponoff.c index 0613fa1..9deb13a 100644 --- a/swaponoff.c +++ b/swaponoff.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include diff --git a/uname.c b/uname.c index 4931ff1..f7e2291 100644 --- a/uname.c +++ b/uname.c @@ -33,6 +33,7 @@ #include #include +#include #include #include diff --git a/util-linux/fbset.c b/util-linux/fbset.c index 72284a6..be1e3c3 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 b666338..928a496 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 a3ea3a8..ed7121a 100644 --- a/util-linux/rdate.c +++ b/util-linux/rdate.c @@ -28,6 +28,8 @@ #include #include #include +#include +#include #include #include #include "busybox.h" diff --git a/util-linux/swaponoff.c b/util-linux/swaponoff.c index 0613fa1..9deb13a 100644 --- a/util-linux/swaponoff.c +++ b/util-linux/swaponoff.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include diff --git a/wc.c b/wc.c index f2d33d6..5472c30 100644 --- a/wc.c +++ b/wc.c @@ -22,6 +22,7 @@ #include #include +#include #include #include "busybox.h" -- cgit v1.1