aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/ManaTools/Shared/RunProgram.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/ManaTools/Shared/RunProgram.pm b/lib/ManaTools/Shared/RunProgram.pm
index dc8c1fe4..1b60652c 100644
--- a/lib/ManaTools/Shared/RunProgram.pm
+++ b/lib/ManaTools/Shared/RunProgram.pm
@@ -186,6 +186,8 @@ make sure environment is set right and keep a copy of the X11 cookie
=item * B<timeout>: execution of $name will be aborted after C<timeout> seconds
+=item * B<exitcode>: function will return the exit code of the process
+
=back
eg:
@@ -327,8 +329,10 @@ sub raw {
} : do {
exec $name, @args;
};
+ my $exitcode = $!;
+ return $exitcode if $options->{exitcode};
if (!$ok) {
- _die_exit("exec of $real_name failed: $!");
+ _die_exit("exec of $real_name failed: $exitcode");
}
}