[dwm] Comments

From: <ste.buffaishere_AT_tin.it>
Date: Thu, 24 Aug 2006 16:58:55 +0100 (GMT+01:00)

I like principles explained in your philosophy, so here is a small diff
that
removes 3 lines from util.c!

diff -r d822b5fbe11e util.c
---
a/util.c. Thu Aug 24 12:07:10 2006 +0200
+++ b/util.c. Thu Aug 24
17:44:20 2006 +0200
@@ -52,15 +52,12 @@ spawn(Arg *arg)
 . if(!arg-
>cmd)
 . . return;
 . if(fork() == 0) {
-. .
if(fork() == 0) {
-. . . if(dpy)
-. .
. . close(ConnectionNumber(dpy));
-. . .
setsid();
-. . . execl(shell, shell, "-c", arg->cmd,
(char *)NULL);
-. . . fprintf(stderr, "dwm: execl '%s -
c %s'", shell, arg->cmd);
-. . . perror(" failed");
-
. . }
-. . exit(0);
+. . daemon(1,0);
// see man daemon(3)
+. . if(dpy)
+. . .
close(ConnectionNumber(dpy));
+. . execl(shell, shell, "-c",
arg->cmd, (char *)NULL);
+. . fprintf(stderr, "dwm: execl '%
s -c %s'", shell, arg->cmd);
+. . perror(" failed");
 .
}
 . wait(0);
 }

Ok, this is a small joke :)
But reading the code
a question arise: what says the philosphy of this project
about
comments?

Here a comment like "we want to avoid zombie process and
detach the spawned
from the current process" would be useful.

Stefano
Received on Sun Aug 27 2006 - 13:15:23 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 14:30:35 UTC