From 314ce5e4451340f912425f249d2061952f2f6149 Mon Sep 17 00:00:00 2001 From: "Luis M. Santos" Date: Mon, 16 Mar 2026 12:36:09 -0400 Subject: [PATCH] made it such that storescp waits for opt_maxChildren if the option is available. removed the need to block on each command execution if we are within the fork context. This reverts a change from 11/14/2025 (9ae75af34fded83278d607ed0e6f7c009e789f71) Signed-off-by: Luis M. Santos --- dcmnet/apps/storescp.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dcmnet/apps/storescp.cc b/dcmnet/apps/storescp.cc index 7a69a16144..083aa68d31 100644 --- a/dcmnet/apps/storescp.cc +++ b/dcmnet/apps/storescp.cc @@ -1051,8 +1051,8 @@ int main(int argc, char *argv[]) */ if (numChildren == opt_maxChildren) { - OFLOG_INFO(storescpLogger, "Maximum number of associations reached, waiting for child process to terminate"); - while (numChildren == opt_maxChildren) + OFLOG_INFO(storescpLogger, "Maximum number of associations reached, waiting for current batch of child processes to terminate"); + for (size_t i = 0; i < opt_maxChildren; i++) { cleanChildren(-1, OFTrue); } @@ -2570,7 +2570,7 @@ static void executeCommand( const OFString &cmd ) * and then clean up the process to avoid interference with the * counter that counts the number of child process in the main process */ - cleanChildren(pid, opt_execSync || opt_forkMode); + cleanChildren(pid, opt_execSync); } else // in case we are the child process, execute the command etc. {