about summary refs log tree commit diff
path: root/manual/process.texi
diff options
context:
space:
mode:
Diffstat (limited to 'manual/process.texi')
-rw-r--r--manual/process.texi5
1 files changed, 3 insertions, 2 deletions
diff --git a/manual/process.texi b/manual/process.texi
index b1f5ef469a..e10534212c 100644
--- a/manual/process.texi
+++ b/manual/process.texi
@@ -608,8 +608,8 @@ indicates that at least one child process has terminated.
 void
 sigchld_handler (int signum)
 @{
-  int pid;
-  int status;
+  int pid, status, serrno;
+  serrno = errno;
   while (1)
     @{
       pid = waitpid (WAIT_ANY, &status, WNOHANG);
@@ -622,6 +622,7 @@ sigchld_handler (int signum)
         break;
       notice_termination (pid, status);
     @}
+  errno = serrno;
 @}
 @end group
 @end smallexample