Просмотр исходного кода

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.
Frank Lichtenheld лет назад: 18
Родитель
Сommit
203d5bb925
1 измененных файлов с 5 добавлено и 0 удалено
  1. 5 0
      scripts/Dpkg/IPC.pm

+ 5 - 0
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;
 }