From e04c90b246fe5fc32b237729c0be51459286860f Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Mon, 18 Jul 2022 12:59:51 +0000 Subject: Fix allread errno management Signed-off-by: Laurent Bercot --- src/clock/s6-clockadd.c | 3 +++ src/clock/s6-clockview.c | 3 +++ src/sbearssl/sbearssl_run.c | 1 + 3 files changed, 7 insertions(+) (limited to 'src') diff --git a/src/clock/s6-clockadd.c b/src/clock/s6-clockadd.c index 010222f..b8a976f 100644 --- a/src/clock/s6-clockadd.c +++ b/src/clock/s6-clockadd.c @@ -1,5 +1,7 @@ /* ISC license. */ +#include + #include #include #include @@ -32,6 +34,7 @@ int main (int argc, char const *const *argv) } { char buf[TAIN_PACK] ; + errno = EPIPE ; if (allread(0, buf, TAIN_PACK) < TAIN_PACK) strerr_diefu1sys(111, "read 16 bytes from stdin") ; tain_unpack(buf, &adj) ; diff --git a/src/clock/s6-clockview.c b/src/clock/s6-clockview.c index 9b18175..e0ae08b 100644 --- a/src/clock/s6-clockview.c +++ b/src/clock/s6-clockview.c @@ -1,5 +1,7 @@ /* ISC license. */ +#include + #include #include #include @@ -14,6 +16,7 @@ int main (void) char fmt[LOCALTMN_FMT] ; PROG = "s6-clockview" ; + errno = EPIPE ; if (allread(0, buf, TAIN_PACK) < TAIN_PACK) strerr_diefu1sys(111, "read from stdin") ; tain_unpack(buf, &adj) ; if (!sysclock_get(&now)) strerr_diefu1sys(111, "sysclock_get") ; diff --git a/src/sbearssl/sbearssl_run.c b/src/sbearssl/sbearssl_run.c index 91e839a..910b70e 100644 --- a/src/sbearssl/sbearssl_run.c +++ b/src/sbearssl/sbearssl_run.c @@ -5,6 +5,7 @@ #include +#include #include #include #include -- cgit v1.2.3