Xinqi Bao's Git
2 * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
3 * See LICENSE file for license details.
15 emallocz(unsigned int size
)
17 void *res
= calloc(1, size
);
20 eprint("fatal: could not malloc() %u bytes\n", size
);
25 eprint(const char *errstr
, ...)
30 vfprintf(stderr
, errstr
, ap
);
36 erealloc(void *ptr
, unsigned int size
)
38 void *res
= realloc(ptr
, size
);
40 eprint("fatal: could not malloc() %u bytes\n", size
);
47 static char *shell
= NULL
;
49 if(!shell
&& !(shell
= getenv("SHELL")))
54 /* the double-fork construct avoids zombie processes */
58 close(ConnectionNumber(dpy
));
60 execl(shell
, shell
, "-c", arg
->cmd
, (char *)NULL
);
61 fprintf(stderr
, "dwm: execl '%s -c %s'", shell
, arg
->cmd
);