From 32790bd7e9a7d006e5d3e44ebb6bc6e2c6bf4e70 Mon Sep 17 00:00:00 2001 From: tadam Date: Wed, 28 Jul 2010 20:55:16 +0000 Subject: [PATCH] Close fd in CMD_Exec Tweaked from original patch. --- ChangeLog | 4 ++++ fvwm/builtins.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index a0736e0e3..e7e408f5c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,8 @@ 2010-07-28 Thomas Adam + * fvwm/builtins.c (CMD_Exec): + Close fd if it's not opened successfully. + +2010-07-28 Thomas Adam * fvwm/update.c (apply_window_updates): * NEWS: Copy over State settings on WindowStyle command. diff --git a/fvwm/builtins.c b/fvwm/builtins.c index 3c1223570..7197aff6c 100644 --- a/fvwm/builtins.c +++ b/fvwm/builtins.c @@ -2459,6 +2459,10 @@ void CMD_Exec(F_CMD_ARGS) fvmm_deinstall_signals(); fd = open("/dev/null", O_RDONLY, 0); dup2(fd,STDIN_FILENO); + + if (fd != STDIN_FILENO) + close(fd); + if (fvwm_setpgrp() == -1) { fvwm_msg(ERR, "exec_function", "setpgrp failed (%s)", -- 2.11.4.GIT