diff options
author | Greg Hudson <ghudson@mit.edu> | 2004-06-23 22:27:34 +0000 |
---|---|---|
committer | Greg Hudson <ghudson@mit.edu> | 2004-06-23 22:27:34 +0000 |
commit | 90881ab99434e9a49e0238b8c7df5c429ff9bd0a (patch) | |
tree | ab50176895d7ba2caf4f8835e91a8f7aca17e021 /zwgc/main.c | |
parent | 7ca14878db2542986e5128baa020773f5d2f4a20 (diff) |
Rewrite the wgfile on SIGUSR1.
Diffstat (limited to 'zwgc/main.c')
-rw-r--r-- | zwgc/main.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/zwgc/main.c b/zwgc/main.c index 83413da..52b9e7a 100644 --- a/zwgc/main.c +++ b/zwgc/main.c @@ -461,6 +461,12 @@ static RETSIGTYPE signal_child() errno = old_errno; } +/* rewrite the wgfile in case it has gone away */ +static RETSIGTYPE signal_usr1() +{ + write_wgfile(); +} + static void setup_signals(dofork) int dofork; { @@ -493,6 +499,9 @@ static void setup_signals(dofork) sa.sa_handler = signal_child; sigaction(SIGCHLD, &sa, (struct sigaction *)0); + sa.sa_handler = signal_usr1; + sigaction(SIGUSR1, &sa, (struct sigaction *)0); + #else /* !POSIX */ if (dofork) { /* Ignore keyboard signals if forking. Bad things will happen. */ @@ -510,6 +519,7 @@ static void setup_signals(dofork) signal(SIGHUP, signal_exit); signal(SIGCHLD, signal_child); signal(SIGPIPE, SIG_IGN); /* so that Xlib gets an error */ + signal(SIGUSR1, signal_usr1); #endif } |