mirror of
https://github.com/LukeSmithxyz/dwm.git
synced 2026-10-05 14:22:31 +03:00
Update dwm.c
This commit is contained in:
@@ -28,6 +28,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <spawn.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <X11/cursorfont.h>
|
#include <X11/cursorfont.h>
|
||||||
@@ -1954,16 +1955,12 @@ sigchld(int unused)
|
|||||||
while (0 < waitpid(-1, NULL, WNOHANG));
|
while (0 < waitpid(-1, NULL, WNOHANG));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern char **environ;
|
||||||
|
|
||||||
void
|
void
|
||||||
spawn(const Arg *arg)
|
spawn(const Arg *arg)
|
||||||
{
|
{
|
||||||
if (fork() == 0) {
|
posix_spawnp(NULL, ((char **)arg->v)[0], NULL, NULL, (char **)arg->v, environ);
|
||||||
if (dpy)
|
|
||||||
close(ConnectionNumber(dpy));
|
|
||||||
setsid();
|
|
||||||
execvp(((char **)arg->v)[0], (char **)arg->v);
|
|
||||||
die("dwm: execvp '%s' failed:", ((char **)arg->v)[0]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -2683,4 +2680,3 @@ main(int argc, char *argv[])
|
|||||||
XCloseDisplay(dpy);
|
XCloseDisplay(dpy);
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user