Xinqi Bao's Git
1 /* See LICENSE file for copyright and license details. */
12 emallocz(unsigned int size
) {
13 void *res
= calloc(1, size
);
16 eprint("fatal: could not malloc() %u bytes\n", size
);
21 eprint(const char *errstr
, ...) {
25 vfprintf(stderr
, errstr
, ap
);
31 spawn(const char *arg
) {
32 static char *shell
= NULL
;
34 if(!shell
&& !(shell
= getenv("SHELL")))
38 /* The double-fork construct avoids zombie processes and keeps the code
39 * clean from stupid signal handlers. */
43 close(ConnectionNumber(dpy
));
45 execl(shell
, shell
, "-c", arg
, (char *)NULL
);
46 fprintf(stderr
, "dwm: execl '%s -c %s'", shell
, arg
);