summaryrefslogtreecommitdiff
path: root/networking/libiproute/iproute.c
diff options
context:
space:
mode:
authorGlenn L McGrath2002-11-28 10:56:38 +0000
committerGlenn L McGrath2002-11-28 10:56:38 +0000
commit9048ae59238cd4bde1e5232d9edcd7b37cf5e84b (patch)
treefe4c65ac086f37176757e8309b74aefd25c03f9c /networking/libiproute/iproute.c
parentdf72536f8e9c337c103727c1d1503985cced73e6 (diff)
downloadbusybox-9048ae59238cd4bde1e5232d9edcd7b37cf5e84b.zip
busybox-9048ae59238cd4bde1e5232d9edcd7b37cf5e84b.tar.gz
Use standard error messages
Diffstat (limited to 'networking/libiproute/iproute.c')
-rw-r--r--networking/libiproute/iproute.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/networking/libiproute/iproute.c b/networking/libiproute/iproute.c
index 8b6e7ee..fcfb409 100644
--- a/networking/libiproute/iproute.c
+++ b/networking/libiproute/iproute.c
@@ -78,7 +78,7 @@ int print_route(struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
}
len -= NLMSG_LENGTH(sizeof(*r));
if (len < 0) {
- fprintf(stderr, "BUG: wrong nlmsg len %d\n", len);
+ error_msg("wrong nlmsg len %d", len);
return -1;
}
@@ -329,7 +329,7 @@ int iproute_modify(int cmd, unsigned flags, int argc, char **argv)
if (d) {
if ((idx = ll_name_to_index(d)) == 0) {
- fprintf(stderr, "Cannot find device \"%s\"\n", d);
+ error_msg("Cannot find device \"%s\"", d);
return -1;
}
addattr32(&req.n, sizeof(req), RTA_OIF, idx);
@@ -452,7 +452,7 @@ static int iproute_list(int argc, char **argv)
if (id) {
if ((idx = ll_name_to_index(id)) == 0) {
- fprintf(stderr, "Cannot find device \"%s\"\n", id);
+ error_msg("Cannot find device \"%s\"", id);
return -1;
}
filter.iif = idx;
@@ -460,8 +460,7 @@ static int iproute_list(int argc, char **argv)
}
if (od) {
if ((idx = ll_name_to_index(od)) == 0) {
- fprintf(stderr, "Cannot find device \"%s\"\n", od);
- return -1;
+ error_msg("Cannot find device \"%s\"", od);
}
filter.oif = idx;
filter.oifmask = -1;
@@ -470,19 +469,16 @@ static int iproute_list(int argc, char **argv)
if (filter.tb != -1) {
if (rtnl_wilddump_request(&rth, do_ipv6, RTM_GETROUTE) < 0) {
- perror("Cannot send dump request");
- exit(1);
+ perror_msg_and_die("Cannot send dump request");
}
} else {
if (rtnl_rtcache_request(&rth, do_ipv6) < 0) {
- perror("Cannot send dump request");
- exit(1);
+ perror_msg_and_die("Cannot send dump request");
}
}
if (rtnl_dump_filter(&rth, print_route, stdout, NULL, NULL) < 0) {
- fprintf(stderr, "Dump terminated\n");
- exit(1);
+ error_msg_and_die"Dump terminated");
}
exit(0);