diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2019-06-18 21:16:32 -0700 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2019-06-18 21:16:32 -0700 |
| commit | a57b5f44dbc0f494639da67cf7acf8e156d6921f (patch) | |
| tree | 844324aeac824427ec17854fa2d3a9d6c5a43d28 /bb.c | |
| parent | 0b977d2a8f0e850735775a870d810c4589a4dfb3 (diff) | |
Removed all the /dev/tty redirection and just dup2()'d it before
exec()ing the user scripts
Diffstat (limited to 'bb.c')
| -rw-r--r-- | bb.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -291,6 +291,11 @@ int run_script(bb_t *bb, const char *cmd) setenv("BBDOTFILES", bb->show_dotfiles ? "1" : "", 1); setenv("BBCURSOR", bb->nfiles ? bb->files[bb->cursor]->fullname : "", 1); + int ttyout, ttyin; + ttyout = open("/dev/tty", O_RDWR); + ttyin = open("/dev/tty", O_RDONLY); + dup2(ttyout, STDOUT_FILENO); + dup2(ttyin, STDIN_FILENO); execvp("sh", args); err("Failed to execute command: '%s'", cmd); return -1; |
