From: Kevin Day Date: Sun, 25 Dec 2022 01:31:32 +0000 (-0600) Subject: Update: Do not treat interrupt not being listened to as an error. X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=b46c272f5813a9a4482803b5de2796c5c4cbd63b;p=fll Update: Do not treat interrupt not being listened to as an error. When the interrupt is received and the interrupt is not in the designated set then an error is being returned. Change this behavior to return a non-error status. --- diff --git a/level_0/f_signal/c/signal.c b/level_0/f_signal/c/signal.c index 86e2836..155ac83 100644 --- a/level_0/f_signal/c/signal.c +++ b/level_0/f_signal/c/signal.c @@ -293,7 +293,7 @@ extern "C" { f_status_t f_signal_wait(const sigset_t * const set, siginfo_t * const information) { if (sigwaitinfo(set, information) == -1) { - if (errno == EINTR) return F_status_set_error(F_interrupt); + if (errno == EINTR) return F_interrupt; if (errno == EINVAL) return F_status_set_error(F_parameter); return F_status_set_error(F_failure); @@ -308,7 +308,7 @@ extern "C" { if (sigtimedwait(set, information, timeout) == -1) { if (errno == EAGAIN) return F_time_out; - if (errno == EINTR) return F_status_set_error(F_interrupt); + if (errno == EINTR) return F_interrupt; if (errno == EINVAL) return F_status_set_error(F_parameter); return F_status_set_error(F_failure); diff --git a/level_0/f_signal/c/signal.h b/level_0/f_signal/c/signal.h index feafbce..f78a97b 100644 --- a/level_0/f_signal/c/signal.h +++ b/level_0/f_signal/c/signal.h @@ -367,8 +367,8 @@ extern "C" { * * @return * F_none if signal is found. + * F_interrupt if interrupted by a signal other than one specified in the signal set. * - * F_interrupt (with error bit) if interrupted by a signal other than one specified in the signal set. * F_parameter (with error bit) if a parameter is invalid. * * F_failure (with error bit) for any other error. @@ -392,9 +392,9 @@ extern "C" { * * @return * F_none if signal is found before time out. + * F_interrupt if interrupted by a signal other than one specified in the signal set. * F_time_out if no signal is find by the time out. * - * F_interrupt (with error bit) if interrupted by a signal other than one specified in the signal set. * F_parameter (with error bit) if a parameter is invalid. * * F_failure (with error bit) for any other error.