diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2019-09-21 13:40:35 -0700 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2019-09-21 13:40:35 -0700 |
| commit | ba7b44a3e7b5b2b240738f3c9b10cb9013a6a304 (patch) | |
| tree | 335a7b4e5ed507e963798cb2cd255869614a0df3 | |
| parent | e04c9d945ccaa8bd7686d89453dc25c3642bb7fb (diff) | |
Fix for broken behavior in the help menu (hanging when reaching the end,
due to not close()ing the file descriptor, and exiting on ctrl-c)
| -rw-r--r-- | bb.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -1044,9 +1044,11 @@ bb_result_t process_cmd(bb_t *bb, const char *cmd) int fds[2]; pipe(fds); pid_t child = fork(); + void (*old_handler)(int) = signal(SIGINT, SIG_IGN); if (child != 0) { close(fds[0]); print_bindings(fds[1]); + close(fds[1]); waitpid(child, NULL, 0); } else { close(fds[1]); @@ -1055,6 +1057,7 @@ bb_result_t process_cmd(bb_t *bb, const char *cmd) execvp("sh", args); } init_term(); + signal(SIGINT, old_handler); bb->dirty = 1; return BB_OK; } |
