~mdw
/
xtoys
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f3b35b6
)
Reap children which die before I get my signal handler installed.
author
mdw
<mdw>
Sat, 21 Nov 1998 22:41:19 +0000
(22:41 +0000)
committer
mdw
<mdw>
Sat, 21 Nov 1998 22:41:19 +0000
(22:41 +0000)
xwait.c
patch
|
blob
|
blame
|
history
diff --git
a/xwait.c
b/xwait.c
index
06e0e5c
..
1a7ecd7
100644
(file)
--- a/
xwait.c
+++ b/
xwait.c
@@
-1,6
+1,6
@@
/* -*-c-*-
*
/* -*-c-*-
*
- * $Id: xwait.c,v 1.
3 1998/11/21 22:30:27
mdw Exp $
+ * $Id: xwait.c,v 1.
4 1998/11/21 22:41:19
mdw Exp $
*
* Wait until prodded by another X client
*
*
* Wait until prodded by another X client
*
@@
-29,6
+29,9
@@
/*----- Revision history --------------------------------------------------*
*
* $Log: xwait.c,v $
/*----- Revision history --------------------------------------------------*
*
* $Log: xwait.c,v $
+ * Revision 1.4 1998/11/21 22:41:19 mdw
+ * Reap children which die before I get my signal handler installed.
+ *
* Revision 1.3 1998/11/21 22:30:27 mdw
* Support GNU-style long options throughout, and introduce proper help
* text to all programs. Update manual pages to match.
* Revision 1.3 1998/11/21 22:30:27 mdw
* Support GNU-style long options throughout, and introduce proper help
* text to all programs. Update manual pages to match.
@@
-222,12
+225,23
@@
int main(int argc, char *argv[])
{
struct sigaction sa;
{
struct sigaction sa;
+ sigset_t ss, oss;
+
+ /* --- Set the handler up --- */
sa.sa_handler = sigchld;
sigemptyset(&sa.sa_mask);
sigaddset(&sa.sa_mask, SIGCHLD);
sa.sa_flags = 0;
sigaction(SIGCHLD, &sa, 0);
sa.sa_handler = sigchld;
sigemptyset(&sa.sa_mask);
sigaddset(&sa.sa_mask, SIGCHLD);
sa.sa_flags = 0;
sigaction(SIGCHLD, &sa, 0);
+
+ /* --- Now reap any which have been waiting around so far --- */
+
+ sigemptyset(&ss);
+ sigaddset(&ss, SIGCHLD);
+ sigprocmask(SIG_BLOCK, &ss, &oss);
+ sigchld(SIGCHLD);
+ sigprocmask(SIG_SETMASK, &oss, 0);
}
/* --- Now wait for an event --- */
}
/* --- Now wait for an event --- */