---
Makefile | 2 +-
tabbed.c | 21 +++++++++------------
2 files changed, 10 insertions(+), 13 deletions(-)
diff --git a/Makefile b/Makefile
index f8f5ba4..54ba350 100644
--- a/Makefile
+++ b/Makefile
_AT_@ -11,7 +11,7 @@ DOCPREFIX = ${PREFIX}/share/doc/${NAME}
# use system flags.
TABBED_CFLAGS = -I/usr/X11R6/include -I/usr/include/freetype2 ${CFLAGS}
TABBED_LDFLAGS = -L/usr/X11R6/lib -lX11 -lfontconfig -lXft ${LDFLAGS}
-TABBED_CPPFLAGS = -DVERSION=\"${VERSION}\" -D_DEFAULT_SOURCE
+TABBED_CPPFLAGS = -DVERSION=\"${VERSION}\" -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=700L
# OpenBSD (uncomment)
#TABBED_CFLAGS = -I/usr/X11R6/include -I/usr/X11R6/include/freetype2 ${CFLAGS}
diff --git a/tabbed.c b/tabbed.c
index eafe28a..477a041 100644
--- a/tabbed.c
+++ b/tabbed.c
_AT_@ -125,7 +125,6 @@ static void run(void);
static void sendxembed(int c, long msg, long detail, long d1, long d2);
static void setcmd(int argc, char *argv[], int);
static void setup(void);
-static void sigchld(int unused);
static void spawn(const Arg *arg);
static int textnw(const char *text, unsigned int len);
static void toggle(const Arg *arg);
_AT_@ -976,9 +975,16 @@ setup(void)
XWMHints *wmh;
XClassHint class_hint;
XSizeHints *size_hint;
+ struct sigaction sa;
- /* clean up any zombies immediately */
- sigchld(0);
+ /* do not transform children into zombies when they terminate */
+ sigemptyset(&sa.sa_mask);
+ sa.sa_flags = SA_NOCLDSTOP | SA_NOCLDWAIT | SA_RESTART;
+ sa.sa_handler = SIG_IGN;
+ sigaction(SIGCHLD, &sa, NULL);
+
+ /* clean up any zombies that might have been inherited */
+ while (waitpid(-1, NULL, WNOHANG) > 0);
/* init screen */
screen = DefaultScreen(dpy);
_AT_@ -1078,15 +1084,6 @@ setup(void)
focus(-1);
}
-void
-sigchld(int unused)
-{
- if (signal(SIGCHLD, sigchld) == SIG_ERR)
- die("%s: cannot install SIGCHLD handler", argv0);
-
- while (0 < waitpid(-1, NULL, WNOHANG));
-}
-
void
spawn(const Arg *arg)
{
--
2.39.1
Received on Sat Mar 11 2023 - 01:20:07 CET
This archive was generated by hypermail 2.3.0 : Sat Mar 11 2023 - 01:24:36 CET