updated for version 7.0021
diff --git a/src/misc1.c b/src/misc1.c
index ec74486..4dc5a41 100644
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -7653,6 +7653,12 @@
     void
 prepare_to_exit()
 {
+#if defined(UNIX)
+    /* Ignore SIGHUP, because a dropped connection may make Vim exit and then
+     * get a SIGHUP while exiting, which causes various reentrent problems. */
+    signal(SIGHUP, SIG_IGN);
+#endif
+
 #ifdef FEAT_GUI
     if (gui.in_use)
     {