From cc83b8d3443d5dfeef500fc8b1dfa2fe4df6dd02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Fri, 7 Aug 2015 21:36:49 +0200 Subject: [PATCH] qrexec: fix exit code from qrexec-client-vm It should be remote process exit code, not the local one. Also do not 'return' from the middle of the look, just use 'break' to execute common cleanup code (which will be introduced in next commit). --- qrexec/qrexec-agent-data.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/qrexec/qrexec-agent-data.c b/qrexec/qrexec-agent-data.c index 5bf9739..e44024d 100644 --- a/qrexec/qrexec-agent-data.c +++ b/qrexec/qrexec-agent-data.c @@ -306,10 +306,9 @@ int process_child_io(libvchan_t *data_vchan, /* also if vchan is disconnected (and we processed all the data), there * is no sense of processing further data */ if (!libvchan_data_ready(data_vchan) && !libvchan_is_open(data_vchan)) { - if (child_process_pid) - return remote_process_status; - else - return child_process_status; + if (child_process_pid == 0) + child_process_status = remote_process_status; + break; } /* child signaled desire to use single socket for both stdin and stdout */ if (stdio_socket_requested) {