Preserve errno after the output write, and if the output pipe is closed, propagate this to the main loop so it does not wait forever for the pipe buffer to empty.

This commit is contained in:
Andrew Wood
2024-10-05 17:05:14 +01:00
parent 29aa64092a
commit bfe301ae1c
3 changed files with 17 additions and 7 deletions
+1
View File
@@ -175,6 +175,7 @@ struct pvstate_s {
volatile sig_atomic_t clear_tty_tostop_on_exit; /* whether to clear tty TOSTOP on exit */
volatile sig_atomic_t suspend_stderr; /* whether writing to stderr is suspended */
volatile sig_atomic_t skip_next_sigcont; /* whether to ignore the next SIGCONT */
volatile sig_atomic_t pipe_closed; /* whether the output pipe was closed */
} flag;
/*****************