mirror of
git://git.proxmox.com/git/pve-common.git
synced 2024-12-22 21:33:47 +03:00
run with timeout: only special-case timeout error in list-context
and not other errors too.
Fixes: a6aa0ae
("run with timeout: return if timeout happened in list context")
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
This commit is contained in:
parent
9c357928ef
commit
eac8b4b872
@ -143,7 +143,8 @@ sub run_with_timeout {
|
||||
# this shouldn't happen anymore?
|
||||
die "unknown error" if $sigcount && !$err; # seems to happen sometimes
|
||||
|
||||
die $err if $err && !wantarray; # assume that user handles timeout err if called in list context
|
||||
# assume that user handles timeout err if called in list context
|
||||
die $err if $err && (!wantarray || !$got_timeout);
|
||||
|
||||
return wantarray ? ($res, $got_timeout) : $res;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user