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:
parent
9ba5bce06f
commit
eba8ed71f0
1
cat.c
1
cat.c
@ -22,6 +22,7 @@
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "busybox.h"
|
||||
|
||||
extern int cat_main(int argc, char **argv)
|
||||
|
@ -22,6 +22,7 @@
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "busybox.h"
|
||||
|
||||
extern int cat_main(int argc, char **argv)
|
||||
|
@ -24,6 +24,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <mntent.h>
|
||||
#include <sys/vfs.h>
|
||||
#include <getopt.h>
|
||||
|
@ -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"
|
||||
|
@ -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)
|
||||
|
@ -22,6 +22,7 @@
|
||||
*/
|
||||
|
||||
#include <getopt.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include "busybox.h"
|
||||
|
||||
|
@ -33,6 +33,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/utsname.h>
|
||||
|
||||
|
@ -22,6 +22,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <getopt.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include "busybox.h"
|
||||
|
||||
|
1
dc.c
1
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"
|
||||
|
1
df.c
1
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>
|
||||
|
3
du.c
3
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"
|
||||
|
3
fbset.c
3
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"))) {
|
||||
|
1
head.c
1
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)
|
||||
|
@ -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)
|
||||
{
|
||||
|
1
lsmod.c
1
lsmod.c
@ -27,6 +27,7 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stddef.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
|
@ -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"
|
||||
|
@ -24,6 +24,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include "busybox.h"
|
||||
|
@ -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"
|
||||
|
@ -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);
|
||||
|
1
mktemp.c
1
mktemp.c
@ -24,6 +24,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include "busybox.h"
|
||||
|
@ -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
1
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"
|
||||
|
1
nc.c
1
nc.c
@ -28,6 +28,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -28,6 +28,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
|
2
rdate.c
2
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"
|
||||
|
1
sort.c
1
sort.c
@ -22,6 +22,7 @@
|
||||
*/
|
||||
|
||||
#include <getopt.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include "busybox.h"
|
||||
|
||||
|
@ -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
uname.c
1
uname.c
@ -33,6 +33,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/utsname.h>
|
||||
|
||||
|
@ -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"))) {
|
||||
|
@ -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);
|
||||
|
@ -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"
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user