input: only change mode of input fd if there is an input fd

This commit is contained in:
Björn Linse
2017-09-06 08:16:59 +02:00
parent 9acd7bfe25
commit 85bc6630c0
4 changed files with 8 additions and 4 deletions

View File

@@ -144,7 +144,9 @@ void mch_exit(int r) FUNC_ATTR_NORETURN
if (!event_teardown() && r == 0) {
r = 1; // Exit with error if main_loop did not teardown gracefully.
}
stream_set_blocking(input_global_fd(), true); // normalize stream (#2598)
if (input_global_fd() >= 0) {
stream_set_blocking(input_global_fd(), true); // normalize stream (#2598)
}
#ifdef EXITFREE
free_all_mem();