apply latest suckless commit
This commit is contained in:
parent
fb4823bea1
commit
b46b7e962f
4
Makefile
4
Makefile
|
@ -54,7 +54,11 @@ speedwm: ${OBJ}
|
||||||
|
|
||||||
ifdef USESTATUS
|
ifdef USESTATUS
|
||||||
status: status.o
|
status: status.o
|
||||||
|
cp status.h status.def.h
|
||||||
|
[ -f "status.rl.h" ] && cp status.rl.h status.h || :
|
||||||
$(CC) status.o $(CFLAGS) $(LDFLAGS) -o speedwm_status
|
$(CC) status.o $(CFLAGS) $(LDFLAGS) -o speedwm_status
|
||||||
|
mv status.def.h status.h
|
||||||
|
chmod 0777 status.h
|
||||||
status.o: status.c status.h
|
status.o: status.c status.h
|
||||||
$(CC) -c status.c
|
$(CC) -c status.c
|
||||||
endif
|
endif
|
||||||
|
|
51
speedwm.c
51
speedwm.c
|
@ -639,7 +639,6 @@ static void hideall(const Arg *arg);
|
||||||
static void showwin(Client *c);
|
static void showwin(Client *c);
|
||||||
static void showhide(Client *c);
|
static void showhide(Client *c);
|
||||||
|
|
||||||
static void sigchld(int unused);
|
|
||||||
#ifdef XINERAMA
|
#ifdef XINERAMA
|
||||||
static void sortscreens(XineramaScreenInfo *screens, int n);
|
static void sortscreens(XineramaScreenInfo *screens, int n);
|
||||||
#endif
|
#endif
|
||||||
|
@ -5127,11 +5126,31 @@ setup(void)
|
||||||
{
|
{
|
||||||
XSetWindowAttributes wa;
|
XSetWindowAttributes wa;
|
||||||
Atom utf8string;
|
Atom utf8string;
|
||||||
|
struct sigaction sa;
|
||||||
|
pid_t pid;
|
||||||
|
|
||||||
/* clean up any zombies immediately */
|
/* do not transform children into zombies when they terminate */
|
||||||
if (signal(SIGCHLD, sigchld) == SIG_ERR)
|
sigemptyset(&sa.sa_mask);
|
||||||
die("can't install SIGCHLD handler:");
|
sa.sa_flags = SA_NOCLDSTOP | SA_NOCLDWAIT | SA_RESTART;
|
||||||
sigchld(0);
|
sa.sa_handler = SIG_IGN;
|
||||||
|
sigaction(SIGCHLD, &sa, NULL);
|
||||||
|
|
||||||
|
/* clean up any zombies (inherited from .xinitrc etc) immediately */
|
||||||
|
while ((pid = waitpid(-1, NULL, WNOHANG) > 0)) {
|
||||||
|
pid_t *p, *lim;
|
||||||
|
|
||||||
|
if (!(p = autostart_pids))
|
||||||
|
continue;
|
||||||
|
lim = &p[autostart_len];
|
||||||
|
|
||||||
|
for (; p < lim; p++) {
|
||||||
|
if (*p == pid) {
|
||||||
|
*p = -1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
signal(SIGHUP, sighup);
|
signal(SIGHUP, sighup);
|
||||||
signal(SIGTERM, sigterm);
|
signal(SIGTERM, sigterm);
|
||||||
|
@ -5326,28 +5345,6 @@ reloadcolors(const Arg *arg)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void
|
|
||||||
sigchld(int unused)
|
|
||||||
{
|
|
||||||
pid_t pid;
|
|
||||||
|
|
||||||
while (0 < (pid = waitpid(-1, NULL, WNOHANG))) {
|
|
||||||
pid_t *p, *lim;
|
|
||||||
|
|
||||||
if (!(p = autostart_pids))
|
|
||||||
continue;
|
|
||||||
lim = &p[autostart_len];
|
|
||||||
|
|
||||||
for (; p < lim; p++) {
|
|
||||||
if (*p == pid) {
|
|
||||||
*p = -1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
sighup(int unused)
|
sighup(int unused)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue