aboutsummaryrefslogtreecommitdiff
path: root/src/or/control.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/or/control.c')
-rw-r--r--src/or/control.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/or/control.c b/src/or/control.c
index 249406de88..76b53e8ba7 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -1119,8 +1119,10 @@ handle_control_signal(control_connection_t *conn, uint32_t len,
if (sig<0)
return 0;
- /* Send DONE first, in case the signal makes us shut down. */
send_control_done(conn);
+ /* Flush the "done" first if the signal might make us shut down. */
+ if (sig == SIGTERM || sig == SIGINT)
+ connection_handle_write(TO_CONN(conn), 1);
control_signal_act(sig);
return 0;
}