mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-07 18:25:59 +01:00
Revert "Set child stdout and stderr to /dev/null (#1000)"
This reverts commit 1e5cab1ee7
.
Breaks a bunch of stuff, e.g. Waybar.
This commit is contained in:
parent
549fdf63f6
commit
478fa7cafe
1 changed files with 0 additions and 21 deletions
|
@ -1,7 +1,5 @@
|
||||||
#include "KeybindManager.hpp"
|
#include "KeybindManager.hpp"
|
||||||
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include <paths.h>
|
|
||||||
#include <regex>
|
#include <regex>
|
||||||
|
|
||||||
CKeybindManager::CKeybindManager() {
|
CKeybindManager::CKeybindManager() {
|
||||||
|
@ -528,25 +526,6 @@ void CKeybindManager::spawn(std::string args) {
|
||||||
// run in grandchild
|
// run in grandchild
|
||||||
close(socket[0]);
|
close(socket[0]);
|
||||||
close(socket[1]);
|
close(socket[1]);
|
||||||
close(STDOUT_FILENO);
|
|
||||||
close(STDERR_FILENO);
|
|
||||||
|
|
||||||
int devnull = open(_PATH_DEVNULL, O_WRONLY);
|
|
||||||
if (devnull == -1) {
|
|
||||||
Debug::log(LOG, "Unable to open /dev/null for writing");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dup2(devnull, STDOUT_FILENO) == -1) {
|
|
||||||
Debug::log(LOG, "Unable to duplicate /dev/null to stdout");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (dup2(devnull, STDERR_FILENO) == -1) {
|
|
||||||
Debug::log(LOG, "Unable to duplicate /dev/null to stderr");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
close(devnull);
|
|
||||||
execl("/bin/sh", "/bin/sh", "-c", args.c_str(), nullptr);
|
execl("/bin/sh", "/bin/sh", "-c", args.c_str(), nullptr);
|
||||||
// exit grandchild
|
// exit grandchild
|
||||||
_exit(0);
|
_exit(0);
|
||||||
|
|
Loading…
Reference in a new issue