From 04097a659ff83a57782b719cddf90706088c294c Mon Sep 17 00:00:00 2001 From: Stephan Bosch Date: Mon, 13 Apr 2020 13:26:04 +0200 Subject: [PATCH] lib-smtp: test-smtp-payload - Properly exit child process. --- src/lib-smtp/test-smtp-payload.c | 33 ++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/src/lib-smtp/test-smtp-payload.c b/src/lib-smtp/test-smtp-payload.c index b9c6a4bd20..7f874d8a10 100644 --- a/src/lib-smtp/test-smtp-payload.c +++ b/src/lib-smtp/test-smtp-payload.c @@ -892,22 +892,27 @@ test_run_client_server( io_loop_run(ioloop); test_server_deinit(); io_loop_destroy(&ioloop); + i_close_fd(&fd_listen); - } else { - if (debug) - i_debug("client: PID=%s", my_pid); - i_set_failure_prefix("CLIENT: "); - i_close_fd(&fd_listen); - /* parent: client */ - ioloop = io_loop_create(); - test_client_init(); - client_init(protocol, client_set); - io_loop_run(ioloop); - test_client_deinit(); - io_loop_destroy(&ioloop); - bind_port = 0; - test_server_kill(); + + test_files_deinit(); + lib_deinit(); + exit(1); } + i_close_fd(&fd_listen); + + if (debug) + i_debug("client: PID=%s", my_pid); + i_set_failure_prefix("CLIENT: "); + /* parent: client */ + ioloop = io_loop_create(); + test_client_init(); + client_init(protocol, client_set); + io_loop_run(ioloop); + test_client_deinit(); + io_loop_destroy(&ioloop); + bind_port = 0; + test_server_kill(); } static void -- 2.47.3