summaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
authorBossCode45 <human.cyborg42@gmail.com>2023-05-23 12:24:12 +1200
committerBossCode45 <human.cyborg42@gmail.com>2023-05-23 12:24:12 +1200
commit9fcd9c718a2250e38be478f567f5e060850b6514 (patch)
treefa6655ea383fb1d946950f342ad98a0444b66103 /main.cpp
parent51bb833685d7c50209d4dfab2154b9b688015464 (diff)
downloadYATwm-9fcd9c718a2250e38be478f567f5e060850b6514.tar.gz
YATwm-9fcd9c718a2250e38be478f567f5e060850b6514.zip
Redirecting fd 0 for children to /dev/null aswell
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/main.cpp b/main.cpp
index efd42dc..d367ead 100644
--- a/main.cpp
+++ b/main.cpp
@@ -203,6 +203,7 @@ void spawn(const KeyArg arg)
if(fork() == 0)
{
int null = open("/dev/null", O_WRONLY);
+ dup2(null, 0);
dup2(null, 1);
dup2(null, 2);
const std::string argsStr = arg.str;
@@ -497,6 +498,7 @@ void bashSpawn(const KeyArg arg)
if(fork() == 0)
{
int null = open("/dev/null", O_WRONLY);
+ dup2(null, 0);
dup2(null, 1);
dup2(null, 2);
system(arg.str);
@@ -1023,5 +1025,7 @@ int main(int argc, char** argv)
}
}
+ //Kill children
+
XCloseDisplay(dpy);
}