From: Frank Lichtenheld Date: Fri, 15 Feb 2008 19:54:23 +0000 (+0100) Subject: Dpkg::IPC: Add wait_child option to fork_and_exec X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=203d5bb92583324efed4fe82e8272a831c780138;p=dpkg Dpkg::IPC: Add wait_child option to fork_and_exec * scripts/Dpkg/IPC.pm (fork_and_exec): If the wait_child option is set to true, wait for the child to exit before returning to the caller. --- diff --git a/scripts/Dpkg/IPC.pm b/scripts/Dpkg/IPC.pm index 9c621f92..7f8a46aa 100644 --- a/scripts/Dpkg/IPC.pm +++ b/scripts/Dpkg/IPC.pm @@ -81,6 +81,11 @@ sub fork_and_exec { close($opts{"from_handle"}) if exists $opts{"from_handle"}; close($opts{"to_handle"}) if exists $opts{"to_handle"}; + if ($opts{"wait_child"}) { + wait_child($pid, cmdline => "@prog"); + return 1; + } + return $pid; }