chiark
/
gitweb
/
~mdw
/
sw-tools
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
13f1b54
)
Fix signal handlers so they don't corrupt `errno'.
author
mdw
<mdw>
Thu, 24 Jun 1999 15:51:17 +0000
(15:51 +0000)
committer
mdw
<mdw>
Thu, 24 Jun 1999 15:51:17 +0000
(15:51 +0000)
src/pres_curses.c
patch
|
blob
|
blame
|
history
src/sw_rsh.c
patch
|
blob
|
blame
|
history
diff --git
a/src/pres_curses.c
b/src/pres_curses.c
index a134eac449124bfd9b8be84249765cdaee84088b..0901df5e6dd3aa9e15ef143bb7b780ba97e9d59b 100644
(file)
--- a/
src/pres_curses.c
+++ b/
src/pres_curses.c
@@
-1,6
+1,6
@@
/* -*-c-*-
*
/* -*-c-*-
*
- * $Id: pres_curses.c,v 1.
1 1999/06/02 16:53:35
mdw Exp $
+ * $Id: pres_curses.c,v 1.
2 1999/06/24 15:51:16
mdw Exp $
*
* Curses-based output presentation
*
*
* Curses-based output presentation
*
@@
-29,8
+29,11
@@
/*----- Revision history --------------------------------------------------*
*
* $Log: pres_curses.c,v $
/*----- Revision history --------------------------------------------------*
*
* $Log: pres_curses.c,v $
- * Revision 1.1 1999/06/02 16:53:35 mdw
- * Initial revision
+ * Revision 1.2 1999/06/24 15:51:16 mdw
+ * Fix signal handlers so they don't corrupt `errno'.
+ *
+ * Revision 1.1.1.1 1999/06/02 16:53:35 mdw
+ * Initial import.
*
*/
*
*/
@@
-121,7
+124,9
@@
static void sizes(void)
#ifdef SIGTSTP
static void sig_tstp(int s)
{
#ifdef SIGTSTP
static void sig_tstp(int s)
{
+ int e = errno;
endwin();
endwin();
+ errno = e;
raise(SIGSTOP);
}
#endif
raise(SIGSTOP);
}
#endif
@@
-131,7
+136,9
@@
static void sig_tstp(int s)
#ifdef SIGTSTP
static void sig_cont(int s)
{
#ifdef SIGTSTP
static void sig_cont(int s)
{
+ int e = errno;
wrefresh(curscr);
wrefresh(curscr);
+ errno = e;
}
#endif
}
#endif
@@
-142,6
+149,8
@@
static void sig_cont(int s)
static void sig_winch(int s)
{
cwin *c;
static void sig_winch(int s)
{
cwin *c;
+ int e = errno;
+
endwin();
refresh();
sizes();
endwin();
refresh();
sizes();
@@
-153,6
+162,7
@@
static void sig_winch(int s)
wnoutrefresh(c->s);
}
doupdate();
wnoutrefresh(c->s);
}
doupdate();
+ errno = e;
}
#endif
}
#endif
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@ --- *