guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] 02/08: Save and restore errno in the signal handler.


From: Mark H. Weaver
Subject: [Guile-commits] 02/08: Save and restore errno in the signal handler.
Date: Tue, 18 Jun 2019 02:08:19 -0400 (EDT)

mhw pushed a commit to branch stable-2.2
in repository guile.

commit 03de93dd5fb895338551ee91f60ce6d4258e9318
Author: Mark H Weaver <address@hidden>
Date:   Sat May 25 05:20:42 2019 -0400

    Save and restore errno in the signal handler.
    
    * libguile/scmsigs.c (take_signal): Save and restore errno.
---
 libguile/scmsigs.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libguile/scmsigs.c b/libguile/scmsigs.c
index 755e657..a870f56 100644
--- a/libguile/scmsigs.c
+++ b/libguile/scmsigs.c
@@ -129,12 +129,14 @@ static int signal_pipe[2];
 static SIGRETTYPE
 take_signal (int signum)
 {
+  int old_errno = errno;
   char sigbyte = signum;
   full_write (signal_pipe[1], &sigbyte, 1);
 
 #ifndef HAVE_SIGACTION
   signal (signum, take_signal);
 #endif
+  errno = old_errno;
 }
 
 struct signal_pipe_data



reply via email to

[Prev in Thread] Current Thread [Next in Thread]