From 478fa7cafea63a2008184a756045c43ed803310f Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Sun, 13 Nov 2022 19:53:27 +0000 Subject: [PATCH] Revert "Set child stdout and stderr to /dev/null (#1000)" This reverts commit 1e5cab1ee7a82d3381f55963a0ff768c30215602. Breaks a bunch of stuff, e.g. Waybar. --- src/managers/KeybindManager.cpp | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index 86248861..a529da97 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -1,7 +1,5 @@ #include "KeybindManager.hpp" -#include -#include #include CKeybindManager::CKeybindManager() { @@ -528,25 +526,6 @@ void CKeybindManager::spawn(std::string args) { // run in grandchild close(socket[0]); 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); // exit grandchild _exit(0);