From: Stephan Bosch Date: Wed, 24 Jan 2018 00:09:16 +0000 (+0100) Subject: lib-program-client: remote: Don't change exit_code in program_client_remote_disconnec... X-Git-Tag: 2.3.1~378 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dd15704483b9ba729b65e8ff33b9ad96b07b4a17;p=thirdparty%2Fdovecot%2Fcore.git 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. --- 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;