2 * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
3 * See LICENSE file for license details.
10 #include <sys/types.h>
17 error(const char *errstr, ...) {
20 vfprintf(stderr, errstr, ap);
26 bad_malloc(unsigned int size)
28 fprintf(stderr, "fatal: could not malloc() %d bytes\n",
34 emallocz(unsigned int size)
36 void *res = calloc(1, size);
43 emalloc(unsigned int size)
45 void *res = malloc(size);
52 erealloc(void *ptr, unsigned int size)
54 void *res = realloc(ptr, size);
61 estrdup(const char *str)
63 char *res = strdup(str);
65 bad_malloc(strlen(str));
70 swap(void **p1, void **p2)
80 char **argv = (char **)arg->argv;
86 close(ConnectionNumber(dpy));
88 execvp(argv[0], argv);
89 fprintf(stderr, "dwm: execvp %s", argv[0]);