mirror of
https://codeberg.org/dwl/dwl.git
synced 2024-12-27 03:36:31 +00:00
Merge branch 'pipe-status'
This commit is contained in:
commit
41bb7a7679
1 changed files with 8 additions and 1 deletions
9
dwl.c
9
dwl.c
|
@ -1809,15 +1809,22 @@ run(char *startup_cmd)
|
||||||
setenv("WAYLAND_DISPLAY", socket, 1);
|
setenv("WAYLAND_DISPLAY", socket, 1);
|
||||||
|
|
||||||
if (startup_cmd) {
|
if (startup_cmd) {
|
||||||
|
int piperw[2];
|
||||||
|
pipe(piperw);
|
||||||
startup_pid = fork();
|
startup_pid = fork();
|
||||||
if (startup_pid < 0)
|
if (startup_pid < 0)
|
||||||
EBARF("startup: fork");
|
EBARF("startup: fork");
|
||||||
if (startup_pid == 0) {
|
if (startup_pid == 0) {
|
||||||
dup2(STDERR_FILENO, STDOUT_FILENO);
|
dup2(piperw[0], STDIN_FILENO);
|
||||||
|
close(piperw[1]);
|
||||||
execl("/bin/sh", "/bin/sh", "-c", startup_cmd, NULL);
|
execl("/bin/sh", "/bin/sh", "-c", startup_cmd, NULL);
|
||||||
EBARF("startup: execl");
|
EBARF("startup: execl");
|
||||||
}
|
}
|
||||||
|
dup2(piperw[1], STDOUT_FILENO);
|
||||||
|
close(piperw[0]);
|
||||||
}
|
}
|
||||||
|
/* If nobody is reading the status output, don't terminate */
|
||||||
|
signal(SIGPIPE, SIG_IGN);
|
||||||
|
|
||||||
/* Run the Wayland event loop. This does not return until you exit the
|
/* Run the Wayland event loop. This does not return until you exit the
|
||||||
* compositor. Starting the backend rigged up all of the necessary event
|
* compositor. Starting the backend rigged up all of the necessary event
|
||||||
|
|
Loading…
Reference in a new issue