[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RP] [PATCH] tmpwm fix: SIG_IGN -> SIG_DFL
From: |
Jérémie Courrèges -Anglas |
Subject: |
[RP] [PATCH] tmpwm fix: SIG_IGN -> SIG_DFL |
Date: |
Sat, 15 Dec 2012 00:55:29 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.2.90 (berkeley-unix) |
Hi ratpoison lovers,
here attached is a patch to fix the behaviour of tmpwm on OpenBSD and
probably other OSes where semantics of signal(SIGCHLD, SIG_IGN) are
different from GNU/Linux. Quoting the OpenBSD signal(3) manpage:
If the func is set to SIG_IGN for the SIGCHLD signal, the system will not
create zombie processes when children of the calling process exit. If
the calling process subsequently issues a wait(2) (or equivalent), it
blocks until all of the calling process's child processes terminate, and
then returns a value of -1 with errno set to ECHILD. This differs from
historical BSD behavior but is consistent with AT&T System V UNIX as well
as the X/Open Portability Guide Issue 4, Version 2 (``XPG4.2'').
I see no reason for this patch to introduce a regression on other
platforms, and testing on Debian Squeeze show no difference in
behaviour.
BTW, the random bug related to tmpwm doesn't seem to be fixed. Since
I couldn't reproduce it with anything but ''newwm ratpoison'', I'd say
that's not a really big problem. :)
--
Jérémie Courrèges-Anglas
GPG Key fingerprint: 61DB D9A0 00A4 67CF 2A90 8961 6191 8FBF 06A1 1494
From 343b19f653a7f8455e8d1aea7594e5b660e3c2ac Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Courr=C3=A8ges-Anglas?= <address@hidden>
Date: Thu, 13 Dec 2012 14:27:54 +0100
Subject: [PATCH] tmpwm fix: SIG_IGN -> SIG_DFL
for signal(SIGCHLD, SIG_IGN) behaves wildly differently across OSes. Fixes
tmpwm hanging after child wm exits on OpenBSD.
---
src/actions.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/actions.c b/src/actions.c
index bf381c8..8559585 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -4758,7 +4758,7 @@ cmd_tmpwm (int interactive UNUSED, struct cmdarg **args)
XSync (dpy, False);
/* Disable our SIGCHLD handler */
- set_sig_handler (SIGCHLD, SIG_IGN);
+ set_sig_handler (SIGCHLD, SIG_DFL);
/* Launch the new WM and wait for it to terminate. */
pid = spawn (ARG_STRING(0), 0, NULL);
PRINT_DEBUG (("spawn pid: %d\n", pid));
--
1.8.0.1
pgpRybdoFRpsb.pgp
Description: PGP signature
- [RP] [PATCH] tmpwm fix: SIG_IGN -> SIG_DFL,
Jérémie Courrèges -Anglas <=