mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-07 07:31:53 -07: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:
@@ -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);
|
||||||
|
Reference in New Issue
Block a user