2 * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
3 * See LICENSE file for license details.
15 emallocz(unsigned int size) {
16 void *res = calloc(1, size);
19 eprint("fatal: could not malloc() %u bytes\n", size);
24 eprint(const char *errstr, ...) {
28 vfprintf(stderr, errstr, ap);
34 erealloc(void *ptr, unsigned int size) {
35 void *res = realloc(ptr, size);
37 eprint("fatal: could not malloc() %u bytes\n", size);
43 static char *shell = NULL;
45 if(!shell && !(shell = getenv("SHELL")))
50 /* The double-fork construct avoids zombie processes and keeps the code
51 * clean from stupid signal handlers. */
55 close(ConnectionNumber(dpy));
57 execl(shell, shell, "-c", arg->cmd, (char *)NULL);
58 fprintf(stderr, "dwm: execl '%s -c %s'", shell, arg->cmd);