diff options
| author | Laurent Bercot <ska-skaware@skarnet.org> | 2026-10-17 23:49:31 +0000 |
|---|---|---|
| committer | Laurent Bercot <ska-skaware@skarnet.org> | 2026-10-17 23:49:31 +0000 |
| commit | de3b3f3bb9653680e2f5be4ff9e353ac1bd7a6a5 (patch) | |
| tree | 4f7c5da99c69a49df33276be2eb3b587c64094d0 | |
| parent | a58812d5404844274298344babdb079e161d164f (diff) | |
| download | skalibs-de3b3f3bb9653680e2f5be4ff9e353ac1bd7a6a5.tar.gz | |
Clean up internal strerr_die invocations
| -rw-r--r-- | src/libenvexec/xmspawn_af.c | 2 | ||||
| -rw-r--r-- | src/libenvexec/xmspawn_afm.c | 2 | ||||
| -rw-r--r-- | src/libenvexec/xmspawn_afn.c | 2 | ||||
| -rw-r--r-- | src/librandom/random_devurandom.c | 4 | ||||
| -rw-r--r-- | src/libstddjb/gol_argv.c | 8 | ||||
| -rw-r--r-- | src/libstddjb/gol_main.c | 2 | ||||
| -rw-r--r-- | src/libunixonacid/sassserver.c | 30 | ||||
| -rw-r--r-- | src/libunixonacid/sassserver_init.c | 2 | ||||
| -rw-r--r-- | src/libunixonacid/sassserver_init_frompipe.c | 2 | ||||
| -rw-r--r-- | src/libunixonacid/sassserver_init_fromsocket.c | 2 |
10 files changed, 28 insertions, 28 deletions
diff --git a/src/libenvexec/xmspawn_af.c b/src/libenvexec/xmspawn_af.c index 3e79114..912a16b 100644 --- a/src/libenvexec/xmspawn_af.c +++ b/src/libenvexec/xmspawn_af.c @@ -8,6 +8,6 @@ pid_t xmspawn_af (char const *file, char const *const *argv, char const *const *envp, size_t envlen, uint16_t flags, cspawn_fileaction const *fa, size_t n) { pid_t pid = mspawn_af(file, argv, envp, envlen, flags, fa, n) ; - if (!pid) strerr_diefu2sys(errno == ENOENT ? 127 : 126, "spawn ", file) ; + if (!pid) strerr_diefusys(errno == ENOENT ? 127 : 126, "spawn ", file) ; return pid ; } diff --git a/src/libenvexec/xmspawn_afm.c b/src/libenvexec/xmspawn_afm.c index 5335fb1..38a06f2 100644 --- a/src/libenvexec/xmspawn_afm.c +++ b/src/libenvexec/xmspawn_afm.c @@ -8,6 +8,6 @@ pid_t xmspawn_afm (char const *file, char const *const *argv, char const *const *envp, size_t envlen, char const *modif, size_t modiflen, uint16_t flags, cspawn_fileaction const *fa, size_t n) { pid_t pid = mspawn_afm(file, argv, envp, envlen, modif, modiflen, flags, fa, n) ; - if (!pid) strerr_diefu2sys(errno == ENOENT ? 127 : 126, "spawn ", file) ; + if (!pid) strerr_diefusys(errno == ENOENT ? 127 : 126, "spawn ", file) ; return pid ; } diff --git a/src/libenvexec/xmspawn_afn.c b/src/libenvexec/xmspawn_afn.c index 5af7c2e..ee2e1a8 100644 --- a/src/libenvexec/xmspawn_afn.c +++ b/src/libenvexec/xmspawn_afn.c @@ -8,6 +8,6 @@ pid_t xmspawn_afn (char const *file, char const *const *argv, char const *const *envp, size_t envlen, char const *modif, size_t modiflen, size_t modifn, uint16_t flags, cspawn_fileaction const *fa, size_t n) { pid_t pid = mspawn_afn(file, argv, envp, envlen, modif, modiflen, modifn, flags, fa, n) ; - if (!pid) strerr_diefu2sys(errno == ENOENT ? 127 : 126, "spawn ", file) ; + if (!pid) strerr_diefusys(errno == ENOENT ? 127 : 126, "spawn ", file) ; return pid ; } diff --git a/src/librandom/random_devurandom.c b/src/librandom/random_devurandom.c index 106c24f..6a83246 100644 --- a/src/librandom/random_devurandom.c +++ b/src/librandom/random_devurandom.c @@ -17,10 +17,10 @@ void random_devurandom (char *s, size_t n) { random_fd = openbc_read("/dev/urandom") ; if (random_fd < 0) - strerr_diefu2sys(111, "open ", "/dev/urandom") ; + strerr_diefusys(111, "open ", "/dev/urandom") ; } errno = EPIPE ; r = allread(random_fd, s, n) ; - if (r < n) strerr_diefu2sys(111, "read from ", "/dev/urandom") ; + if (r < n) strerr_diefusys(111, "read from ", "/dev/urandom") ; errno = e ; } diff --git a/src/libstddjb/gol_argv.c b/src/libstddjb/gol_argv.c index 9e648e3..aa714c4 100644 --- a/src/libstddjb/gol_argv.c +++ b/src/libstddjb/gol_argv.c @@ -13,14 +13,14 @@ unsigned int gol_argv (char const *const *argv, gol_bool const *b, unsigned int if (problem > 0) { char s[2] = { argv[-r-1][problem], 0 } ; - strerr_dief4x(100, "unrecognized ", "short ", "option: ", s) ; + strerr_dief(100, "unrecognized ", "short ", "option: ", s) ; } else if (!problem) - strerr_dief3x(100, "invalid ", "option: ", argv[-r-1]) ; + strerr_dief(100, "invalid ", "option: ", argv[-r-1]) ; else if (problem == -1) - strerr_dief4x(100, "unrecognized ", "boolean ", "option: ", argv[-r-1]) ; + strerr_dief(100, "unrecognized ", "boolean ", "option: ", argv[-r-1]) ; else - strerr_dief3x(100, "unrecognized ", "option with argument: ", argv[-r-1]) ; + strerr_dief(100, "unrecognized ", "option with argument: ", argv[-r-1]) ; } else return r ; } diff --git a/src/libstddjb/gol_main.c b/src/libstddjb/gol_main.c index d7b1026..aa449a9 100644 --- a/src/libstddjb/gol_main.c +++ b/src/libstddjb/gol_main.c @@ -7,7 +7,7 @@ unsigned int gol_main (int argc, char const *const *argv, gol_bool const *b, unsigned int bn, gol_arg const *a, unsigned int an, uint64_t *br, char const **ar) { - if (argc < 1 || argv[argc]) strerr_diefu1x(103, "gol: invalid argc/argv") ; + if (argc < 1 || argv[argc]) strerr_diefu(103, "gol: invalid argc/argv") ; if (argc == 1) return 1 ; return 1 + gol_argv(argv + 1, b, bn, a, an, br, ar) ; } diff --git a/src/libunixonacid/sassserver.c b/src/libunixonacid/sassserver.c index e87084d..85e57f5 100644 --- a/src/libunixonacid/sassserver.c +++ b/src/libunixonacid/sassserver.c @@ -26,7 +26,7 @@ static void sassserver_sync_answer (sassserver *a, int e) if (!textmessage_put(textmessage_sender_1, pack, 4)) { (*a->cleanupf)(a->aux) ; - strerr_diefu1sys(111, "textmessage_put") ; + strerr_diefusys(111, "textmessage_put") ; } } @@ -54,7 +54,7 @@ static int sassserver_parse_protocol (struct iovec const *v, void *aux) if (vlen-- < 5) { (*a->cleanupf)(a->aux) ; - strerr_dief1x(100, "invalid client request") ; + strerr_dief(100, "invalid client request") ; } switch (*s++) { @@ -64,7 +64,7 @@ static int sassserver_parse_protocol (struct iovec const *v, void *aux) if (vlen != 4) { (*a->cleanupf)(a->aux) ; - strerr_dief1x(100, "invalid client request") ; + strerr_dief(100, "invalid client request") ; } uint32_unpack_big(s, &id) ; if (!avltree_search(&a->by_id, &id, &handle)) sassserver_sync_answer(a, EINVAL) ; @@ -85,12 +85,12 @@ static int sassserver_parse_protocol (struct iovec const *v, void *aux) if (vlen < 20) { (*a->cleanupf)(a->aux) ; - strerr_dief1x(100, "invalid client request") ; + strerr_dief(100, "invalid client request") ; } if (!gensetdyn_new(&a->queries, &handle)) { (*a->cleanupf)(a->aux) ; - strerr_diefu1sys(111, "gensetdyn_new") ; + strerr_diefusys(111, "gensetdyn_new") ; } p = SASSSERVER_QUERY(a, handle) ; uint32_unpack_big(s, &p->id) ; s += 4 ; vlen -= 4 ; @@ -101,11 +101,11 @@ static int sassserver_parse_protocol (struct iovec const *v, void *aux) if (len != vlen) { (*a->cleanupf)(a->aux) ; - strerr_dief1x(100, "invalid client request") ; + strerr_dief(100, "invalid client request") ; } if (timeout) { - if (!tain_from_millisecs(&p->deadline, timeout)) strerr_dief1x(100, "invalid client request") ; + if (!tain_from_millisecs(&p->deadline, timeout)) strerr_dief(100, "invalid client request") ; tain_add_g(&p->deadline, &p->deadline) ; } else tain_add_g(&p->deadline, &tain_infinite_relative) ; @@ -114,7 +114,7 @@ static int sassserver_parse_protocol (struct iovec const *v, void *aux) || !avltree_insert(&a->by_id, handle)) { (*a->cleanupf)(a->aux) ; - strerr_diefu1sys(111, "avltree_insert") ; + strerr_diefusys(111, "avltree_insert") ; } if (!p->data) { @@ -122,7 +122,7 @@ static int sassserver_parse_protocol (struct iovec const *v, void *aux) if (!p->data) { (*a->cleanupf)(a->aux) ; - strerr_diefu1sys(111, "alloc") ; + strerr_diefusys(111, "alloc") ; } memset(p->data, 0, a->datasize) ; } @@ -133,7 +133,7 @@ static int sassserver_parse_protocol (struct iovec const *v, void *aux) } default : (*a->cleanupf)(a->aux) ; - strerr_dief1x(100, "invalid client request") ; + strerr_dief(100, "invalid client request") ; } return 1 ; } @@ -153,7 +153,7 @@ void sassserver_async_failure (sassserver *a, uint32_t handle, int e) if (!textmessage_put(textmessage_sender_x, pack, 8)) { (*a->cleanupf)(a->aux) ; - strerr_diefu1sys(111, "textmessage_put") ; + strerr_diefusys(111, "textmessage_put") ; } sassserver_remove(a, handle) ; } @@ -169,7 +169,7 @@ void sassserver_async_successv (sassserver *a, uint32_t handle, uint32_t flags, if (!textmessage_putv(textmessage_sender_x, vv, n+1)) { (*a->cleanupf)(a->aux) ; - strerr_diefu1sys(111, "textmessage_putv") ; + strerr_diefusys(111, "textmessage_putv") ; } if (!(flags & SASS_FLAG_KEEP)) sassserver_remove(a, handle) ; } @@ -214,13 +214,13 @@ void sassserver_write_event (sassserver *a, iopause_fd const *x) if (!textmessage_sender_flush(textmessage_sender_1) && !error_isagain(errno)) { (*a->cleanupf)(a->aux) ; - strerr_diefu1sys(111, "flush stdout") ; + strerr_diefusys(111, "flush stdout") ; } if (x[2].revents & IOPAUSE_WRITE) if (!textmessage_sender_flush(textmessage_sender_x) && !error_isagain(errno)) { (*a->cleanupf)(a->aux) ; - strerr_diefu1sys(111, "flush asyncout") ; + strerr_diefusys(111, "flush asyncout") ; } } @@ -232,7 +232,7 @@ int sassserver_read_event (sassserver *a, iopause_fd const *x) { if (errno == EPIPE) return 1 ; (*a->cleanupf)(a->aux) ; - strerr_diefu1sys(111, "read messages from client") ; + strerr_diefusys(111, "read messages from client") ; } } return 0 ; diff --git a/src/libunixonacid/sassserver_init.c b/src/libunixonacid/sassserver_init.c index 9aa0725..337e1b1 100644 --- a/src/libunixonacid/sassserver_init.c +++ b/src/libunixonacid/sassserver_init.c @@ -8,6 +8,6 @@ void sassserver_init (sassserver *a, char const *banner1, char const *banner2, sassserver_send_func_ref sendf, sassserver_cancel_func_ref cancelf, size_t datasize, free_func_ref cleanupf, void *aux, tain const *deadline, tain *stamp) { if (!textclient_server_01x_init(banner1, strlen(banner1), banner2, strlen(banner2), deadline, stamp)) - strerr_diefu1sys(111, "sync with client") ; + strerr_diefusys(111, "sync with client") ; sassserver_init_structures(a, sendf, cancelf, datasize, cleanupf, aux) ; } diff --git a/src/libunixonacid/sassserver_init_frompipe.c b/src/libunixonacid/sassserver_init_frompipe.c index e75e60b..f315671 100644 --- a/src/libunixonacid/sassserver_init_frompipe.c +++ b/src/libunixonacid/sassserver_init_frompipe.c @@ -8,6 +8,6 @@ void sassserver_init_frompipe (sassserver *a, char const *banner1, char const *banner2, sassserver_send_func_ref sendf, sassserver_cancel_func_ref cancelf, size_t datasize, free_func_ref cleanupf, void *aux, tain const *deadline, tain *stamp) { if (!textclient_server_01x_init_frompipe(banner1, strlen(banner1), banner2, strlen(banner2), deadline, stamp)) - strerr_diefu1sys(111, "sync with client") ; + strerr_diefusys(111, "sync with client") ; sassserver_init_structures(a, sendf, cancelf, datasize, cleanupf, aux) ; } diff --git a/src/libunixonacid/sassserver_init_fromsocket.c b/src/libunixonacid/sassserver_init_fromsocket.c index 48fd1d4..c898efa 100644 --- a/src/libunixonacid/sassserver_init_fromsocket.c +++ b/src/libunixonacid/sassserver_init_fromsocket.c @@ -8,6 +8,6 @@ void sassserver_init_fromsocket (sassserver *a, char const *banner1, char const *banner2, sassserver_send_func_ref sendf, sassserver_cancel_func_ref cancelf, size_t datasize, free_func_ref cleanupf, void *aux, tain const *deadline, tain *stamp) { if (!textclient_server_01x_init_fromsocket(banner1, strlen(banner1), banner2, strlen(banner2), deadline, stamp)) - strerr_diefu1sys(111, "sync with client") ; + strerr_diefusys(111, "sync with client") ; sassserver_init_structures(a, sendf, cancelf, datasize, cleanupf, aux) ; } |
