From: Raphael Hertzog Date: Thu, 21 Feb 2008 00:45:47 +0000 (+0100) Subject: Dpkg::IPC: Add nocheck option to wait_child() X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba4236b5b0c51f14b62d7b5ae9da9269c9bd5235;p=dpkg Dpkg::IPC: Add nocheck option to wait_child() * scripts/Dpkg/IPC.pm (wait_child): Add nocheck option to not check the return status of the child process. --- diff --git a/scripts/Dpkg/IPC.pm b/scripts/Dpkg/IPC.pm index 5af0e13e..bcd5ff6e 100644 --- a/scripts/Dpkg/IPC.pm +++ b/scripts/Dpkg/IPC.pm @@ -238,7 +238,8 @@ sub fork_and_exec { Takes as first argument the pid of the process to wait for. Remaining arguments are taken as a hash of options. Returns -nothing. +nothing. Fails if the child has been ended by a signal or +if it exited non-zero. Options: @@ -249,6 +250,12 @@ Options: String to identify the child process in error messages. Defaults to "child process". +=item nocheck + +If true do not check the return status of the child (and thus +do not fail it it has been killed or if it exited with a +non-zero return code). + =back =cut @@ -258,7 +265,9 @@ sub wait_child { $opts{"cmdline"} ||= _g("child process"); error(_g("no PID set, cannot wait end of process")) unless $pid; $pid == waitpid($pid, 0) or syserr(_g("wait for %s"), $opts{"cmdline"}); - subprocerr($opts{"cmdline"}) if $?; + unless ($opts{"nocheck"}) { + subprocerr($opts{"cmdline"}) if $?; + } } 1;