diff options
author | dzwdz | 2023-08-30 00:03:43 +0200 |
---|---|---|
committer | dzwdz | 2023-08-30 00:03:43 +0200 |
commit | cf7877737ff5032f8bad59d57b048f66c4813b5b (patch) | |
tree | ec9c66772331594c30b34062a2cb0f72719d6f6e /src/cmd/netdog/nd.c | |
parent | f71af249cfb9ca9eb0832cc46437b2c5cb7bb217 (diff) |
style: get rid of eprintf
Diffstat (limited to 'src/cmd/netdog/nd.c')
-rw-r--r-- | src/cmd/netdog/nd.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/cmd/netdog/nd.c b/src/cmd/netdog/nd.c index 2caaab9..221dc9c 100644 --- a/src/cmd/netdog/nd.c +++ b/src/cmd/netdog/nd.c @@ -1,12 +1,11 @@ #include <camellia.h> #include <camellia/compat.h> #include <camellia/syscalls.h> +#include <err.h> #include <stdio.h> #include <string.h> #include <thread.h> -#define eprintf(fmt, ...) fprintf(stderr, "netdog: "fmt"\n" __VA_OPT__(,) __VA_ARGS__) - hid_t conn; void send_stdin(void *arg) { (void)arg; @@ -32,13 +31,13 @@ void recv_stdout(void *arg) { (void)arg; int main(int argc, char **argv) { if (argc < 2) { - eprintf("no argument"); + fprintf(stderr, "usage: netdog /net/connect/source/target/proto/port\n"); return 1; } conn = camellia_open(argv[1], OPEN_RW); if (conn < 0) { - eprintf("couldn't open '%s', err %u", argv[1], -conn); + err(1, "open %s", argv[1]); return -conn; } |