]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-program-client: local: Stop immediately when child program without I/O ends.
authorStephan Bosch <stephan.bosch@dovecot.fi>
Mon, 26 Feb 2018 16:12:29 +0000 (17:12 +0100)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Tue, 25 Jun 2019 09:22:31 +0000 (12:22 +0300)
Particularly, don't perform this by calling the input handler.

src/lib-program-client/program-client-local.c

index baf79db75ec3ce812efbdccfd495d6aac4d626cf..3dccc81064d66135ce256609914a50112d5dd963 100644 (file)
@@ -130,16 +130,17 @@ static void
 program_client_local_waitchild(const struct child_wait_status *status,
                               struct program_client_local *plclient)
 {
+       struct program_client *pclient = &plclient->client;
+
        i_assert(plclient->pid == status->pid);
 
        plclient->status = status->status;
        plclient->exited = TRUE;
        plclient->pid = -1;
 
-       if (plclient->stopping)
+       if (plclient->stopping ||
+           (pclient->fd_in < 0 && pclient->fd_out < 0))
                program_client_local_exited(plclient);
-       else
-               program_client_program_input(&plclient->client);
 }
 
 static int