]> err.no Git - dpkg/commitdiff
Dpkg::IPC: Add wait_child option to fork_and_exec
authorFrank Lichtenheld <djpig@debian.org>
Fri, 15 Feb 2008 19:54:23 +0000 (20:54 +0100)
committerFrank Lichtenheld <djpig@debian.org>
Fri, 15 Feb 2008 19:54:23 +0000 (20:54 +0100)
* 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.

scripts/Dpkg/IPC.pm

index 9c621f922a12c5ec66239776b21a1fd846866890..7f8a46aac1088f1d2dc100b823b097cf5c91a360 100644 (file)
@@ -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;
 }