From cf7877737ff5032f8bad59d57b048f66c4813b5b Mon Sep 17 00:00:00 2001 From: dzwdz Date: Wed, 30 Aug 2023 00:03:43 +0200 Subject: style: get rid of eprintf --- src/cmd/netstack/netstack.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/cmd/netstack/netstack.c') diff --git a/src/cmd/netstack/netstack.c b/src/cmd/netstack/netstack.c index 4cdf409..a8e011e 100644 --- a/src/cmd/netstack/netstack.c +++ b/src/cmd/netstack/netstack.c @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include @@ -29,20 +30,20 @@ void fs_thread(void *arg); int main(int argc, char **argv) { if (argc < 4) { - eprintf("usage: netstack iface ip gateway"); + fprintf(stderr, "usage: netstack iface ip gateway\n"); return 1; } state.raw_h = camellia_open(argv[1], OPEN_RW); if (state.raw_h < 0) { - eprintf("couldn't open %s", argv[1]); + err(1, "open %s", argv[1]); return 1; } if (ip_parse(argv[2], &state.ip) < 0) { - eprintf("invalid ip"); + errx(1, "invalid ip: %s", argv[2]); return -1; } if (ip_parse(argv[3], &state.gateway) < 0) { - eprintf("invalid gateway"); + errx(1, "invalid gateway: %s", argv[2]); return -1; } setproctitle(argv[2]); -- cgit v1.2.3