1 /* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
2 * See LICENSE file for license details.
14 emallocz(unsigned int size) {
15 void *res = calloc(1, size);
18 eprint("fatal: could not malloc() %u bytes\n", size);
23 eprint(const char *errstr, ...) {
27 vfprintf(stderr, errstr, ap);
34 static char *shell = NULL;
36 if(!shell && !(shell = getenv("SHELL")))
40 /* The double-fork construct avoids zombie processes and keeps the code
41 * clean from stupid signal handlers. */
45 close(ConnectionNumber(dpy));
47 execl(shell, shell, "-c", arg->cmd, (char *)NULL);
48 fprintf(stderr, "dwm: execl '%s -c %s'", shell, arg->cmd);