From dd15704483b9ba729b65e8ff33b9ad96b07b4a17 Mon Sep 17 00:00:00 2001 From: Stephan Bosch Date: Wed, 24 Jan 2018 01:09:16 +0100 Subject: [PATCH] lib-program-client: remote: Don't change exit_code in program_client_remote_disconnect() when program_input is already NULL. When the program_input is NULL, the stream is finished, meaning that the exit_code is set based on the return code. There can be a program_input for remote streams, even when the program produces no output. --- src/lib-program-client/program-client-remote.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib-program-client/program-client-remote.c b/src/lib-program-client/program-client-remote.c index 56707e4040..250538a665 100644 --- a/src/lib-program-client/program-client-remote.c +++ b/src/lib-program-client/program-client-remote.c @@ -544,8 +544,10 @@ void program_client_remote_disconnect(struct program_client *pclient, bool force timeout_remove(&prclient->to_retry); - if (pclient->error == PROGRAM_CLIENT_ERROR_NONE && !prclient->noreply && - pclient->program_input != NULL && !force) { + if (pclient->program_input == NULL) { + /* nothing */ + } else if (pclient->error == PROGRAM_CLIENT_ERROR_NONE && + !prclient->noreply && !force) { const unsigned char *data; size_t size; -- 2.47.3