Patchs from Jeff Garzik <jgarzik@mandrakesoft.com> to cleanup

warnings with glibc 2.2 and use always use xfopen
 -Erik
This commit is contained in:
Eric Andersen 2001-03-09 14:36:42 +00:00
parent 9ba5bce06f
commit eba8ed71f0
34 changed files with 40 additions and 16 deletions

1
cat.c
View File

@ -22,6 +22,7 @@
*/
#include <stdlib.h>
#include <string.h>
#include "busybox.h"
extern int cat_main(int argc, char **argv)

View File

@ -22,6 +22,7 @@
*/
#include <stdlib.h>
#include <string.h>
#include "busybox.h"
extern int cat_main(int argc, char **argv)

View File

@ -24,6 +24,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <mntent.h>
#include <sys/vfs.h>
#include <getopt.h>

View 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"

View 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)

View File

@ -22,6 +22,7 @@
*/
#include <getopt.h>
#include <string.h>
#include <stdlib.h>
#include "busybox.h"

View File

@ -33,6 +33,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/utsname.h>

View File

@ -22,6 +22,7 @@
#include <stdio.h>
#include <getopt.h>
#include <string.h>
#include <stdlib.h>
#include "busybox.h"

1
dc.c
View 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"

1
df.c
View File

@ -24,6 +24,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <mntent.h>
#include <sys/vfs.h>
#include <getopt.h>

3
du.c
View 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"

View 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"))) {

1
head.c
View 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)

View 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)
{

View File

@ -27,6 +27,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stddef.h>
#include <errno.h>
#include <unistd.h>

View 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"

View File

@ -24,6 +24,7 @@
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include "busybox.h"

View 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"

View 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);

View File

@ -24,6 +24,7 @@
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include "busybox.h"

View File

@ -27,6 +27,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stddef.h>
#include <errno.h>
#include <unistd.h>

1
mt.c
View 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"

1
nc.c
View File

@ -28,6 +28,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>

View 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)
{

View File

@ -28,6 +28,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>

View 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"

1
sort.c
View File

@ -22,6 +22,7 @@
*/
#include <getopt.h>
#include <string.h>
#include <stdlib.h>
#include "busybox.h"

View 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>

View File

@ -33,6 +33,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/utsname.h>

View 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"))) {

View 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);

View 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"

View 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>

1
wc.c
View File

@ -22,6 +22,7 @@
#include <stdio.h>
#include <getopt.h>
#include <string.h>
#include <stdlib.h>
#include "busybox.h"