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.2.35~120 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0f04ac8c3fb13e90b245072cb25fadd4d0bb37d4;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 23d0b241ed..aea61675c6 100644 --- a/src/lib-program-client/program-client-remote.c +++ b/src/lib-program-client/program-client-remote.c @@ -309,8 +309,10 @@ void program_client_remote_disconnect(struct program_client *pclient, bool force struct program_client_remote *prclient = (struct program_client_remote *)pclient; - 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;