Xinqi Bao's Git
projects
/
dwm.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
inline
| side by side
new stuff
[dwm.git]
/
util.c
diff --git
a/util.c
b/util.c
index
2414b39
..
e19e3e9
100644
(file)
--- a/
util.c
+++ b/
util.c
@@
-9,14
+9,6
@@
#include <sys/wait.h>
#include <unistd.h>
#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 *
/* extern */
void *
@@
-25,7
+17,7
@@
emallocz(unsigned int size)
void *res = calloc(1, size);
if(!res)
void *res = calloc(1, size);
if(!res)
-
bad_malloc(
size);
+
eprint("fatal: could not malloc() %u bytes\n",
size);
return res;
}
return res;
}
@@
-45,7
+37,7
@@
erealloc(void *ptr, unsigned int size)
{
void *res = realloc(ptr, size);
if(!res)
{
void *res = realloc(ptr, size);
if(!res)
-
bad_malloc(
size);
+
eprint("fatal: could not malloc() %u bytes\n",
size);
return res;
}
return res;
}
@@
-64,7
+56,7
@@
spawn(Arg *arg)
if(dpy)
close(ConnectionNumber(dpy));
setsid();
if(dpy)
close(ConnectionNumber(dpy));
setsid();
- execl(shell, shell, "-c", arg->cmd, NULL);
+ execl(shell, shell, "-c", arg->cmd,
(char *)
NULL);
fprintf(stderr, "dwm: execl '%s -c %s'", shell, arg->cmd);
perror(" failed");
}
fprintf(stderr, "dwm: execl '%s -c %s'", shell, arg->cmd);
perror(" failed");
}