summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--LICENSE1
-rw-r--r--README3
-rw-r--r--config.mk2
-rw-r--r--dwm.c25
4 files changed, 18 insertions, 13 deletions
diff --git a/LICENSE b/LICENSE
index 9138fe2..fa47bd5 100644
--- a/LICENSE
+++ b/LICENSE
@@ -9,6 +9,7 @@ MIT/X Consortium License
9© 2007-2008 Enno Gottox Boland <gottox at s01 dot de> 9© 2007-2008 Enno Gottox Boland <gottox at s01 dot de>
10© 2007-2008 Peter Hartlich <sgkkr at hartlich dot com> 10© 2007-2008 Peter Hartlich <sgkkr at hartlich dot com>
11© 2008 Martin Hurton <martin dot hurton at gmail dot com> 11© 2008 Martin Hurton <martin dot hurton at gmail dot com>
12© 2008 Neale Pickett <neale dot woozle dot org>
12 13
13Permission is hereby granted, free of charge, to any person obtaining a 14Permission is hereby granted, free of charge, to any person obtaining a
14copy of this software and associated documentation files (the "Software"), 15copy of this software and associated documentation files (the "Software"),
diff --git a/README b/README
index b11cb00..2e14579 100644
--- a/README
+++ b/README
@@ -38,11 +38,12 @@ the DISPLAY environment variable is set correctly, e.g.:
38In order to display status info in the bar, you can do something 38In order to display status info in the bar, you can do something
39like this in your .xinitrc: 39like this in your .xinitrc:
40 40
41 dwm &
41 while true 42 while true
42 do 43 do
43 xsetroot -name "`date` `uptime | sed 's/.*,//'`" 44 xsetroot -name "`date` `uptime | sed 's/.*,//'`"
44 sleep 1 45 sleep 1
45 done | dwm 46 done
46 47
47 48
48Configuration 49Configuration
diff --git a/config.mk b/config.mk
index 9a4233f..2875865 100644
--- a/config.mk
+++ b/config.mk
@@ -1,5 +1,5 @@
1# dwm version 1# dwm version
2VERSION = 5.3.1 2VERSION = 5.4
3 3
4# Customize below to fit your system 4# Customize below to fit your system
5 5
diff --git a/dwm.c b/dwm.c
index dc63a0b..d6dc467 100644
--- a/dwm.c
+++ b/dwm.c
@@ -178,6 +178,7 @@ static void setlayout(const Arg *arg);
178static void setmfact(const Arg *arg); 178static void setmfact(const Arg *arg);
179static void setup(void); 179static void setup(void);
180static void showhide(Client *c); 180static void showhide(Client *c);
181static void sigchld(int signal);
181static void spawn(const Arg *arg); 182static void spawn(const Arg *arg);
182static void tag(const Arg *arg); 183static void tag(const Arg *arg);
183static int textnw(const char *text, unsigned int len); 184static int textnw(const char *text, unsigned int len);
@@ -1340,22 +1341,24 @@ showhide(Client *c) {
1340 } 1341 }
1341} 1342}
1342 1343
1344
1345void
1346sigchld(int signal) {
1347 while(0 < waitpid(-1, NULL, WNOHANG));
1348}
1349
1343void 1350void
1344spawn(const Arg *arg) { 1351spawn(const Arg *arg) {
1345 /* The double-fork construct avoids zombie processes and keeps the code 1352 signal(SIGCHLD, sigchld);
1346 * clean from stupid signal handlers. */
1347 if(fork() == 0) { 1353 if(fork() == 0) {
1348 if(fork() == 0) { 1354 if(dpy)
1349 if(dpy) 1355 close(ConnectionNumber(dpy));
1350 close(ConnectionNumber(dpy)); 1356 setsid();
1351 setsid(); 1357 execvp(((char **)arg->v)[0], (char **)arg->v);
1352 execvp(((char **)arg->v)[0], (char **)arg->v); 1358 fprintf(stderr, "dwm: execvp %s", ((char **)arg->v)[0]);
1353 fprintf(stderr, "dwm: execvp %s", ((char **)arg->v)[0]); 1359 perror(" failed");
1354 perror(" failed");
1355 }
1356 exit(0); 1360 exit(0);
1357 } 1361 }
1358 wait(0);
1359} 1362}
1360 1363
1361void 1364void