Loading src/feh.h +2 −0 Original line number Diff line number Diff line Loading @@ -201,4 +201,6 @@ extern char *mode; /* label for the current mode */ /* to terminate long-running children with SIGALRM */ extern int childpid; extern int control_via_stdin; #endif src/keyevents.c +2 −1 Original line number Diff line number Diff line Loading @@ -271,6 +271,7 @@ void feh_event_handle_stdin() char stdin_buf[2]; KeySym keysym = NoSymbol; if (read(STDIN_FILENO, &stdin_buf, 1) == -1) { if (control_via_stdin) weprintf("reading a command from stdin failed"); return; } Loading src/main.c +1 −1 Original line number Diff line number Diff line Loading @@ -234,7 +234,7 @@ void feh_clean_exit(void) if(disp) XCloseDisplay(disp); if (control_via_stdin) if (control_via_stdin && isatty(STDIN_FILENO)) if (tcsetattr(STDIN_FILENO, TCSANOW, &old_term_settings) == -1) eprintf("tcsetattr failed"); Loading src/signals.c +8 −2 Original line number Diff line number Diff line Loading @@ -40,7 +40,8 @@ void setup_signal_handlers() (sigaddset(&feh_ss, SIGALRM) == -1) || (sigaddset(&feh_ss, SIGTERM) == -1) || (sigaddset(&feh_ss, SIGQUIT) == -1) || (sigaddset(&feh_ss, SIGINT) == -1)) (sigaddset(&feh_ss, SIGINT) == -1) || (sigaddset(&feh_ss, SIGTTIN) == -1)) { weprintf("Failed to set up signal masks"); return; Loading @@ -56,7 +57,8 @@ void setup_signal_handlers() (sigaction(SIGALRM, &feh_sh, NULL) == -1) || (sigaction(SIGTERM, &feh_sh, NULL) == -1) || (sigaction(SIGQUIT, &feh_sh, NULL) == -1) || (sigaction(SIGINT, &feh_sh, NULL) == -1)) (sigaction(SIGINT, &feh_sh, NULL) == -1) || (sigaction(SIGTTIN, &feh_sh, NULL) == -1)) { weprintf("Failed to set up signal handler"); return; Loading @@ -75,6 +77,10 @@ void feh_handle_signal(int signo) if (childpid) killpg(childpid, SIGINT); return; case SIGTTIN: // we were probably backgrounded while we were running control_via_stdin = 0; return; case SIGINT: case SIGTERM: case SIGQUIT: Loading Loading
src/feh.h +2 −0 Original line number Diff line number Diff line Loading @@ -201,4 +201,6 @@ extern char *mode; /* label for the current mode */ /* to terminate long-running children with SIGALRM */ extern int childpid; extern int control_via_stdin; #endif
src/keyevents.c +2 −1 Original line number Diff line number Diff line Loading @@ -271,6 +271,7 @@ void feh_event_handle_stdin() char stdin_buf[2]; KeySym keysym = NoSymbol; if (read(STDIN_FILENO, &stdin_buf, 1) == -1) { if (control_via_stdin) weprintf("reading a command from stdin failed"); return; } Loading
src/main.c +1 −1 Original line number Diff line number Diff line Loading @@ -234,7 +234,7 @@ void feh_clean_exit(void) if(disp) XCloseDisplay(disp); if (control_via_stdin) if (control_via_stdin && isatty(STDIN_FILENO)) if (tcsetattr(STDIN_FILENO, TCSANOW, &old_term_settings) == -1) eprintf("tcsetattr failed"); Loading
src/signals.c +8 −2 Original line number Diff line number Diff line Loading @@ -40,7 +40,8 @@ void setup_signal_handlers() (sigaddset(&feh_ss, SIGALRM) == -1) || (sigaddset(&feh_ss, SIGTERM) == -1) || (sigaddset(&feh_ss, SIGQUIT) == -1) || (sigaddset(&feh_ss, SIGINT) == -1)) (sigaddset(&feh_ss, SIGINT) == -1) || (sigaddset(&feh_ss, SIGTTIN) == -1)) { weprintf("Failed to set up signal masks"); return; Loading @@ -56,7 +57,8 @@ void setup_signal_handlers() (sigaction(SIGALRM, &feh_sh, NULL) == -1) || (sigaction(SIGTERM, &feh_sh, NULL) == -1) || (sigaction(SIGQUIT, &feh_sh, NULL) == -1) || (sigaction(SIGINT, &feh_sh, NULL) == -1)) (sigaction(SIGINT, &feh_sh, NULL) == -1) || (sigaction(SIGTTIN, &feh_sh, NULL) == -1)) { weprintf("Failed to set up signal handler"); return; Loading @@ -75,6 +77,10 @@ void feh_handle_signal(int signo) if (childpid) killpg(childpid, SIGINT); return; case SIGTTIN: // we were probably backgrounded while we were running control_via_stdin = 0; return; case SIGINT: case SIGTERM: case SIGQUIT: Loading