print an error if fork failed (resource / process limits)
This commit is contained in:
1 parent
ebfe671988
commit
1d07715ebd
1 file changed
+7
-1
@@ -1654,10 +1654,16 @@ void
|
|||||||
spawn(const Arg *arg)
|
spawn(const Arg *arg)
|
||||||
{
|
{
|
||||||
struct sigaction sa;
|
struct sigaction sa;
|
||||||
|
pid_t pid;
|
||||||
|
|
||||||
if (arg->v == dmenucmd)
|
if (arg->v == dmenucmd)
|
||||||
dmenumon[0] = '0' + selmon->num;
|
dmenumon[0] = '0' + selmon->num;
|
||||||
if (fork() == 0) {
|
|
||||||
|
if ((pid = fork()) == -1) {
|
||||||
|
fprintf(stderr, "dwm: fork failed: %s\n", strerror(errno));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (pid == 0) {
|
||||||
if (dpy)
|
if (dpy)
|
||||||
close(ConnectionNumber(dpy));
|
close(ConnectionNumber(dpy));
|
||||||
setsid();
|
setsid();
|
||||||
|
|||||||
Reference in new issue
Block a user