chiark
/
gitweb
/
~mdw
/
sw-tools
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix signal handlers so they don't corrupt `errno'.
[sw-tools]
/
src
/
sw_rsh.c
diff --git
a/src/sw_rsh.c
b/src/sw_rsh.c
index 4f2be0d35e2d2f4330b309838e58dbfd49f10488..0406798ba312a59b92b5554345094a793fcef5d8 100644
(file)
--- a/
src/sw_rsh.c
+++ b/
src/sw_rsh.c
@@
-1,6
+1,6
@@
/* -*-c-*-
*
/* -*-c-*-
*
- * $Id: sw_rsh.c,v 1.
3 1999/06/18 18:58:54
mdw Exp $
+ * $Id: sw_rsh.c,v 1.
4 1999/06/24 15:51:17
mdw Exp $
*
* Run remote commands
*
*
* Run remote commands
*
@@
-29,6
+29,9
@@
/*----- Revision history --------------------------------------------------*
*
* $Log: sw_rsh.c,v $
/*----- Revision history --------------------------------------------------*
*
* $Log: sw_rsh.c,v $
+ * Revision 1.4 1999/06/24 15:51:17 mdw
+ * Fix signal handlers so they don't corrupt `errno'.
+ *
* Revision 1.3 1999/06/18 18:58:54 mdw
* Signal handling fixes.
*
* Revision 1.3 1999/06/18 18:58:54 mdw
* Signal handling fixes.
*
@@
-632,6
+635,7
@@
done:
static void sigchld(int sig)
{
static void sigchld(int sig)
{
+ int e = errno;
#ifdef DEBUG_SIGCHLD
int status;
while (waitpid(-1, &status, WNOHANG) > 0) {
#ifdef DEBUG_SIGCHLD
int status;
while (waitpid(-1, &status, WNOHANG) > 0) {
@@
-648,6
+652,7
@@
static void sigchld(int sig)
while (waitpid(-1, 0, WNOHANG) > 0)
;
#endif
while (waitpid(-1, 0, WNOHANG) > 0)
;
#endif
+ errno = e;
}
/* --- @swrsh@ --- *
}
/* --- @swrsh@ --- *