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/netdog/nd.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/cmd/netdog') 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 #include #include +#include #include #include #include -#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; } -- cgit v1.2.3