mirror of
https://github.com/neovim/neovim.git
synced 2025-09-20 02:08:17 +00:00
preserve_exit: Ignore SIGHUP
closes #9274 ref #9028 If stdin closed then read_error_exit calls preserve_exit. Handling SIGHUP during preserve_exit would cause a premature teardown, and conflicts with e.g. ui_bridge_stop which waits for TUI to teardown. Vim ignores SIGHUP in its prepare_to_exit and getout_preserve_modified routines: /* Ignore SIGHUP, because a dropped connection causes a read error, which * makes Vim exit and then handling SIGHUP causes various reentrance * problems. */ signal(SIGHUP, SIG_IGN);
This commit is contained in:
@@ -52,6 +52,7 @@
|
||||
#include "nvim/window.h"
|
||||
#include "nvim/os/os.h"
|
||||
#include "nvim/os/shell.h"
|
||||
#include "nvim/os/signal.h"
|
||||
#include "nvim/os/input.h"
|
||||
#include "nvim/os/time.h"
|
||||
#include "nvim/event/stream.h"
|
||||
@@ -2653,6 +2654,8 @@ void preserve_exit(void)
|
||||
}
|
||||
|
||||
really_exiting = true;
|
||||
// Ignore SIGHUP while we are already exiting. #9274
|
||||
signal_reject_deadly();
|
||||
mch_errmsg(IObuff);
|
||||
mch_errmsg("\n");
|
||||
ui_flush();
|
||||
|
Reference in New Issue
Block a user