#include <sys/wait.h>
#include <unistd.h>
-/* static */
-
-static void
-bad_malloc(unsigned int size)
-{
- eprint("fatal: could not malloc() %u bytes\n", size);
-}
-
/* extern */
void *
void *res = calloc(1, size);
if(!res)
- bad_malloc(size);
+ eprint("fatal: could not malloc() %u bytes\n", size);
return res;
}
exit(EXIT_FAILURE);
}
+void *
+erealloc(void *ptr, unsigned int size)
+{
+ void *res = realloc(ptr, size);
+ if(!res)
+ eprint("fatal: could not malloc() %u bytes\n", size);
+ return res;
+}
+
void
spawn(Arg *arg)
{
close(ConnectionNumber(dpy));
setsid();
execl(shell, shell, "-c", arg->cmd, NULL);
- fprintf(stderr, "dwm: execl '%s'", arg->cmd);
+ fprintf(stderr, "dwm: execl '%s -c %s'", shell, arg->cmd);
perror(" failed");
}
exit(0);