summaryrefslogtreecommitdiff
path: root/src/cmd/netstack/netstack.c
diff options
context:
space:
mode:
authordzwdz2023-08-30 00:03:43 +0200
committerdzwdz2023-08-30 00:03:43 +0200
commitcf7877737ff5032f8bad59d57b048f66c4813b5b (patch)
treeec9c66772331594c30b34062a2cb0f72719d6f6e /src/cmd/netstack/netstack.c
parentf71af249cfb9ca9eb0832cc46437b2c5cb7bb217 (diff)
style: get rid of eprintf
Diffstat (limited to 'src/cmd/netstack/netstack.c')
-rw-r--r--src/cmd/netstack/netstack.c9
1 files changed, 5 insertions, 4 deletions
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 <camellia.h>
#include <camellia/compat.h>
#include <camellia/syscalls.h>
+#include <err.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdlib.h>
@@ -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]);