commit 62a491e36d493bf4585b348a4c28c5ed9bd3ea4e from: a@null date: Fri Dec 12 19:55:03 2008 UTC re-applied Neale's spawn patch, credited Neale in LICENSE commit - 0b5dcf229f64a23438e6ef5929d78b7f9bd48355 commit + 62a491e36d493bf4585b348a4c28c5ed9bd3ea4e blob - 9138fe2af9c194afd33aa89fe0d5f4fc60b5bf46 blob + fa47bd56fb5dd27e442c40c220d5e8fb8d81802f --- LICENSE +++ LICENSE @@ -9,6 +9,7 @@ MIT/X Consortium License © 2007-2008 Enno Gottox Boland © 2007-2008 Peter Hartlich © 2008 Martin Hurton +© 2008 Neale Pickett Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), blob - b11cb00abf5682d4f11c117cd16a8fb9718a5c28 blob + 2e14579248b91bf06f88e20f63082de679fc47d5 --- README +++ README @@ -38,11 +38,12 @@ the DISPLAY environment variable is set correctly, e.g In order to display status info in the bar, you can do something like this in your .xinitrc: + dwm & while true do xsetroot -name "`date` `uptime | sed 's/.*,//'`" sleep 1 - done | dwm + done Configuration blob - 9a4233fbcf80c556a2ddfd5cd50e999aa2354652 blob + 2875865eeed34b22bfba0912ef4ba2c3b201fdb6 --- config.mk +++ config.mk @@ -1,5 +1,5 @@ # dwm version -VERSION = 5.3.1 +VERSION = 5.4 # Customize below to fit your system blob - dc63a0b75c32e369a2542579894393fde808b134 blob + d6dc4676e1a31cc69f18ccca4363fb8645b4b2d3 --- dwm.c +++ dwm.c @@ -178,6 +178,7 @@ static void setlayout(const Arg *arg); static void setmfact(const Arg *arg); static void setup(void); static void showhide(Client *c); +static void sigchld(int signal); static void spawn(const Arg *arg); static void tag(const Arg *arg); static int textnw(const char *text, unsigned int len); @@ -1340,22 +1341,24 @@ showhide(Client *c) { } } + void +sigchld(int signal) { + while(0 < waitpid(-1, NULL, WNOHANG)); +} + +void spawn(const Arg *arg) { - /* The double-fork construct avoids zombie processes and keeps the code - * clean from stupid signal handlers. */ + signal(SIGCHLD, sigchld); if(fork() == 0) { - if(fork() == 0) { - if(dpy) - close(ConnectionNumber(dpy)); - setsid(); - execvp(((char **)arg->v)[0], (char **)arg->v); - fprintf(stderr, "dwm: execvp %s", ((char **)arg->v)[0]); - perror(" failed"); - } + if(dpy) + close(ConnectionNumber(dpy)); + setsid(); + execvp(((char **)arg->v)[0], (char **)arg->v); + fprintf(stderr, "dwm: execvp %s", ((char **)arg->v)[0]); + perror(" failed"); exit(0); } - wait(0); } void