aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2026-01-01 12:07:54 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2026-01-01 12:07:54 +0000
commit2631aaccbc57388450403520e585d4440fec10fc (patch)
treed9c70dd3895fd04d80897ca587e8c1ef4bb56ede /src
parent8cabc449368ba128ba1580e2f8f0435c2397a533 (diff)
downloadexecline-2631aaccbc57388450403520e585d4440fec10fc.tar.gz
Prepare for 2.9.8.1; signal handlers must save/restore errno
Diffstat (limited to 'src')
-rw-r--r--src/libexecline/el_forx_pidinfo.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libexecline/el_forx_pidinfo.c b/src/libexecline/el_forx_pidinfo.c
index 61c5a26..8bd12bb 100644
--- a/src/libexecline/el_forx_pidinfo.c
+++ b/src/libexecline/el_forx_pidinfo.c
@@ -1,5 +1,7 @@
/* ISC license. */
+#include <errno.h>
+
#include <skalibs/djbunix.h>
#include <execline/execline.h>
@@ -15,11 +17,13 @@ int el_forx_isok (unsigned short const *tab, unsigned int n, unsigned short code
void el_forx_sigchld_handler (int sig)
{
+ int e = errno ;
for (;;)
{
ssize_t r = wait_pids_nohang(el_forx_pidinfo->tab, el_forx_pidinfo->len, &el_forx_pidinfo->wstat) ;
if (r <= 0) break ;
el_forx_pidinfo->tab[r-1] = el_forx_pidinfo->tab[--el_forx_pidinfo->len] ;
}
+ errno = e ;
(void)sig ;
}