diff options
author | Boris Faure <billiob@gmail.com> | 2016-12-05 21:53:15 +0100 |
---|---|---|
committer | Boris Faure <billiob@gmail.com> | 2016-12-05 21:53:15 +0100 |
commit | 390e4193d0a0637c1b853e20d99afb7034a87123 (patch) | |
tree | 8fc673a797e7fac161d32e2f0db1890745081b46 | |
parent | termpty: avoid race between exit of the program and reading from it (diff) | |
download | terminology-390e4193d0a0637c1b853e20d99afb7034a87123.tar.gz |
termpty: fix possible issue when reading and the shell exited
-rw-r--r-- | src/bin/termpty.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bin/termpty.c b/src/bin/termpty.c index 2795d17..3f79640 100644 --- a/src/bin/termpty.c +++ b/src/bin/termpty.c @@ -293,11 +293,11 @@ _cb_exe_exit(void *data, ty->hand_exe_exit = NULL; /* Read everything till the end */ - do + res = ECORE_CALLBACK_PASS_ON; + while (ty->hand_fd && res != ECORE_CALLBACK_CANCEL) { res = _cb_fd_read(ty, ty->hand_fd); } - while (res != ECORE_CALLBACK_CANCEL); if (ty->hand_fd) ecore_main_fd_handler_del(ty->hand_fd); ty->hand_fd = NULL; |