mirror of
https://github.com/sheumann/hush.git
synced 2024-09-12 00:55:11 +00:00
*: use fopen_or_warn in few more places
This commit is contained in:
parent
275b929e01
commit
f90ab183d6
@ -477,8 +477,7 @@ static void load_fs_info(const char *filename)
|
|||||||
int old_fstab = 1;
|
int old_fstab = 1;
|
||||||
struct fs_info *fs;
|
struct fs_info *fs;
|
||||||
|
|
||||||
if ((f = fopen(filename, "r")) == NULL) {
|
if ((f = fopen_or_warn(filename, "r")) == NULL) {
|
||||||
bb_perror_msg("WARNING: cannot open %s", filename);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
while (!feof(f)) {
|
while (!feof(f)) {
|
||||||
|
@ -560,9 +560,8 @@ static int if_readlist_proc(char *target)
|
|||||||
if (!target)
|
if (!target)
|
||||||
proc_read = 1;
|
proc_read = 1;
|
||||||
|
|
||||||
fh = fopen(_PATH_PROCNET_DEV, "r");
|
fh = fopen_or_warn(_PATH_PROCNET_DEV, "r");
|
||||||
if (!fh) {
|
if (!fh) {
|
||||||
bb_perror_msg("warning: cannot open %s, limiting output", _PATH_PROCNET_DEV);
|
|
||||||
return if_readconf();
|
return if_readconf();
|
||||||
}
|
}
|
||||||
fgets(buf, sizeof buf, fh); /* eat line */
|
fgets(buf, sizeof buf, fh); /* eat line */
|
||||||
|
@ -91,7 +91,6 @@ static int print_route(struct sockaddr_nl *who ATTRIBUTE_UNUSED,
|
|||||||
int host_len = -1;
|
int host_len = -1;
|
||||||
SPRINT_BUF(b1);
|
SPRINT_BUF(b1);
|
||||||
|
|
||||||
|
|
||||||
if (n->nlmsg_type != RTM_NEWROUTE && n->nlmsg_type != RTM_DELROUTE) {
|
if (n->nlmsg_type != RTM_NEWROUTE && n->nlmsg_type != RTM_DELROUTE) {
|
||||||
fprintf(stderr, "Not a route: %08x %08x %08x\n",
|
fprintf(stderr, "Not a route: %08x %08x %08x\n",
|
||||||
n->nlmsg_len, n->nlmsg_type, n->nlmsg_flags);
|
n->nlmsg_len, n->nlmsg_type, n->nlmsg_flags);
|
||||||
|
@ -891,7 +891,8 @@ static int builtin_cd(char **argv)
|
|||||||
static int builtin_exec(char **argv)
|
static int builtin_exec(char **argv)
|
||||||
{
|
{
|
||||||
if (argv[1] == NULL)
|
if (argv[1] == NULL)
|
||||||
return EXIT_SUCCESS; /* Really? */
|
return EXIT_SUCCESS; /* bash does this */
|
||||||
|
// FIXME: if exec fails, bash does NOT exit! We do...
|
||||||
pseudo_exec_argv(argv + 1);
|
pseudo_exec_argv(argv + 1);
|
||||||
/* never returns */
|
/* never returns */
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user