From d9488baa63351cafd237f5af15018ea5898ec0bc Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Thu, 2 Sep 2021 19:11:11 +0000 Subject: Pass errno as unsigned char Signed-off-by: Laurent Bercot --- src/libs6/s6_fdholder_setdump.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/libs6/s6_fdholder_setdump.c') diff --git a/src/libs6/s6_fdholder_setdump.c b/src/libs6/s6_fdholder_setdump.c index 9c88f6b..e1462ef 100644 --- a/src/libs6/s6_fdholder_setdump.c +++ b/src/libs6/s6_fdholder_setdump.c @@ -34,7 +34,7 @@ int s6_fdholder_setdump (s6_fdholder_t *a, s6_fdholder_fd_t const *list, unsigne if (!unixmessage_sender_timed_flush(&a->connection.out, deadline, stamp)) return 0 ; if (sanitize_read(unixmessage_timed_receive(&a->connection.in, &m, deadline, stamp)) < 0) return 0 ; if (!m.len || m.nfds) { unixmessage_drop(&m) ; return (errno = EPROTO, 0) ; } - if (m.s[0]) return (errno = m.s[0], 0) ; + if (m.s[0]) return (errno = (unsigned char)m.s[0], 0) ; if (m.len != 5) return (errno = EPROTO, 0) ; uint32_unpack_big(m.s + 1, &trips) ; if (trips != 1 + (ntot-1) / UNIXMESSAGE_MAXFDS) return (errno = EPROTO, 0) ; @@ -71,10 +71,10 @@ int s6_fdholder_setdump (s6_fdholder_t *a, s6_fdholder_fd_t const *list, unsigne unixmessage_drop(&m) ; return (errno = EPROTO, 0) ; } - if (!error_isagain(m.s[0]) && i < trips-1) - return errno = m.s[0] ? m.s[0] : EPROTO, 0 ; + if (!error_isagain((unsigned char)m.s[0]) && i < trips-1) + return errno = m.s[0] ? (unsigned char)m.s[0] : EPROTO, 0 ; if (i == trips - 1 && m.s[0]) - return errno = error_isagain(m.s[0]) ? EPROTO : m.s[0], 0 ; + return errno = error_isagain((unsigned char)m.s[0]) ? EPROTO : (unsigned char)m.s[0], 0 ; } } return 1 ; -- cgit v1.2.3