aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2014-02-11 12:37:48 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2014-02-11 12:37:48 +0200
commitbda97b4552e8ebb136c790e7077b69641cd05759 (patch)
tree519e28f7a96292a956e189668cca49ac8659603b
parent17f865ee24c3c6cf6a04c14e18823edd81c14dd6 (diff)
downloadjumper-bda97b4552e8ebb136c790e7077b69641cd05759.tar.gz
jumper-bda97b4552e8ebb136c790e7077b69641cd05759.tar.bz2
Avoid asynchronous access to process lists.
* src/jumper.c (child_cleanup): New variable. (sigmain): On SIGCHLD, set child_cleanup instead of calling progman_cleanup. (main): Call progman_cleanup if needed.
-rw-r--r--src/jumper.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/jumper.c b/src/jumper.c
index 85eba7b..76ecfb7 100644
--- a/src/jumper.c
+++ b/src/jumper.c
@@ -96,6 +96,7 @@ enum {
};
int command = command_none;
+int child_cleanup = 0;
void
sigmain(int sig)
@@ -103,7 +104,7 @@ sigmain(int sig)
signo = sig;
switch (signo) {
case SIGCHLD:
- progman_cleanup();
+ child_cleanup = 1;
break;
case SIGALRM:
break;
@@ -248,7 +249,11 @@ main(int argc, char **argv)
int rc;
struct timeval tv;
fd_set rdset;
-
+
+ if (child_cleanup) {
+ progman_cleanup();
+ child_cleanup = 0;
+ }
if (command == command_reload) {
reload();
command = command_none;

Return to:

Send suggestions and report system problems to the System administrator.