From 06011c29aef19d8ed90ebf48095e1ff2a846ba23 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Tue, 29 Nov 2022 02:24:47 +0000 Subject: Prepare for 2.13.0.0, revamp strerr Signed-off-by: Laurent Bercot --- src/libstddjb/child_spawn.c | 2 +- src/libstddjb/child_spawn0.c | 2 +- src/libstddjb/child_spawn1_internal.c | 2 +- src/libstddjb/child_spawn2.c | 2 +- src/libstddjb/child_spawn3.c | 2 +- src/libstddjb/hiercopy_tmp.c | 2 +- src/libstddjb/prog.c | 2 +- src/libstddjb/strerr.c | 35 ----------------------------------- src/libstddjb/strerr_sys.c | 22 ---------------------- 9 files changed, 7 insertions(+), 64 deletions(-) delete mode 100644 src/libstddjb/strerr.c delete mode 100644 src/libstddjb/strerr_sys.c (limited to 'src/libstddjb') diff --git a/src/libstddjb/child_spawn.c b/src/libstddjb/child_spawn.c index 5a157a8..aa70deb 100644 --- a/src/libstddjb/child_spawn.c +++ b/src/libstddjb/child_spawn.c @@ -20,7 +20,7 @@ #else #include -#include +#include #include #endif diff --git a/src/libstddjb/child_spawn0.c b/src/libstddjb/child_spawn0.c index 927bb0e..5b59b20 100644 --- a/src/libstddjb/child_spawn0.c +++ b/src/libstddjb/child_spawn0.c @@ -47,7 +47,7 @@ pid_t child_spawn0 (char const *prog, char const *const *argv, char const *const #include #include -#include +#include #include #include #include diff --git a/src/libstddjb/child_spawn1_internal.c b/src/libstddjb/child_spawn1_internal.c index 436d19e..be154f0 100644 --- a/src/libstddjb/child_spawn1_internal.c +++ b/src/libstddjb/child_spawn1_internal.c @@ -71,7 +71,7 @@ pid_t child_spawn1_internal (char const *prog, char const *const *argv, char con #include #include -#include +#include #include #include #include diff --git a/src/libstddjb/child_spawn2.c b/src/libstddjb/child_spawn2.c index d35b4a6..bddd97f 100644 --- a/src/libstddjb/child_spawn2.c +++ b/src/libstddjb/child_spawn2.c @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #endif diff --git a/src/libstddjb/child_spawn3.c b/src/libstddjb/child_spawn3.c index 255e3c1..733df74 100644 --- a/src/libstddjb/child_spawn3.c +++ b/src/libstddjb/child_spawn3.c @@ -20,7 +20,7 @@ #include #include -#include +#include #include #endif diff --git a/src/libstddjb/hiercopy_tmp.c b/src/libstddjb/hiercopy_tmp.c index 79b7b46..4e69bbe 100644 --- a/src/libstddjb/hiercopy_tmp.c +++ b/src/libstddjb/hiercopy_tmp.c @@ -5,7 +5,7 @@ #include #include #include -#include + #include #include #include diff --git a/src/libstddjb/prog.c b/src/libstddjb/prog.c index f6c683c..3c5f7f5 100644 --- a/src/libstddjb/prog.c +++ b/src/libstddjb/prog.c @@ -2,6 +2,6 @@ /* MT-unsafe */ -#include +#include char const *PROG = "(none)" ; diff --git a/src/libstddjb/strerr.c b/src/libstddjb/strerr.c deleted file mode 100644 index ae70477..0000000 --- a/src/libstddjb/strerr.c +++ /dev/null @@ -1,35 +0,0 @@ -/* ISC license. */ - -/* MT-unsafe */ - -#include -#include -#include -#include - -void strerr_warn (char const *x1, char const *x2, char const *x3, char const *x4, char const *x5, char const *x6, char const *x7, char const *x8, char const *x9, char const *x10, char const *se) -{ - int e = errno ; - if (x1) buffer_puts(buffer_2, x1) ; - if (x2) buffer_puts(buffer_2, x2) ; - if (x3) buffer_puts(buffer_2, x3) ; - if (x4) buffer_puts(buffer_2, x4) ; - if (x5) buffer_puts(buffer_2, x5) ; - if (x6) buffer_puts(buffer_2, x6) ; - if (x7) buffer_puts(buffer_2, x7) ; - if (x8) buffer_puts(buffer_2, x8) ; - if (x9) buffer_puts(buffer_2, x9) ; - if (x10) buffer_puts(buffer_2, x10) ; - if (se) buffer_puts(buffer_2, se) ; - buffer_putflush(buffer_2, "\n", 1) ; - errno = e ; -} - -void strerr_die (int e, char const *x1, char const *x2, char const *x3, char const *x4, char const *x5, char const *x6, char const *x7, char const *x8, char const *x9, char const *x10, char const *se) -{ - strerr_warn(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, se) ; - _exit(e) ; - - /* No, OpenBSD, this noreturn function does NOT return. - Please learn what _exit() does. */ -} diff --git a/src/libstddjb/strerr_sys.c b/src/libstddjb/strerr_sys.c deleted file mode 100644 index e388f5a..0000000 --- a/src/libstddjb/strerr_sys.c +++ /dev/null @@ -1,22 +0,0 @@ -/* ISC license. */ - -/* MT-unsafe */ - -#include -#include -#include -#include - -void strerr_warnsys (char const *x1, char const *x2, char const *x3, char const *x4, char const *x5, char const *x6, char const *x7, char const *x8, char const *x9, char const *x10) -{ - strerr_warn(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, strerror(errno)) ; -} - -void strerr_diesys (int e, char const *x1, char const *x2, char const *x3, char const *x4, char const *x5, char const *x6, char const *x7, char const *x8, char const *x9, char const *x10) -{ - strerr_warnsys(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10) ; - _exit(e) ; - - /* No, OpenBSD, this noreturn function does NOT return. - Please learn what _exit() does. */ -} -- cgit v1.2.3