From da054c3782f25b3b18243f6c76dcfcf90ba70274 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 7 Jan 2015 14:46:45 +0100 Subject: ptyfwd: simplify how we handle vhangups a bit --- src/machine/machinectl.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/machine/machinectl.c') diff --git a/src/machine/machinectl.c b/src/machine/machinectl.c index 7e995cab68..be3896a19b 100644 --- a/src/machine/machinectl.c +++ b/src/machine/machinectl.c @@ -1240,13 +1240,14 @@ static int on_machine_removed(sd_bus *bus, sd_bus_message *m, void *userdata, sd if (*forward) { /* If the forwarder is already initialized, tell it to - * exit on the next hangup */ + * exit on the next vhangup(), so that we still flush + * out what might be queued and exit then. */ - r = pty_forward_set_repeat(*forward, false); + r = pty_forward_set_ignore_vhangup(*forward, false); if (r >= 0) return 0; - log_error_errno(r, "Failed to set repeat flag: %m"); + log_error_errno(r, "Failed to set ignore_vhangup flag: %m"); } /* On error, or when the forwarder is not initialized yet, quit immediately */ @@ -1341,7 +1342,7 @@ static int login_machine(int argc, char *argv[], void *userdata) { return log_error_errno(r, "Failed to run event loop: %m"); pty_forward_get_last_char(forward, &last_char); - machine_died = pty_forward_get_repeat(forward) == 0; + machine_died = pty_forward_get_ignore_vhangup(forward) == 0; forward = pty_forward_free(forward); -- cgit v1.2.3-54-g00ecf