diff options
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -12,6 +12,7 @@ #include "bfs.h" #include "bftw.h" #include "dstring.h" +#include "util.h" #include <assert.h> #include <dirent.h> #include <errno.h> @@ -447,8 +448,17 @@ bool eval_exec(const struct expr *expr, struct eval_state *state) { exec_chdir(ftwbuf); } + if (expr->exec_flags & EXEC_CONFIRM) { + if (redirect(STDIN_FILENO, "/dev/null", O_RDONLY) < 0) { + perror("redirect()"); + goto exit; + } + } + execvp(argv[0], argv); perror("execvp()"); + + exit: _Exit(EXIT_FAILURE); } |