X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=blobdiff_plain;f=src%2FPVE%2FTools.pm;h=4a8b5d9b530521af9c6a033da6ad2a4952e5bc07;hp=0a7efeb8dce920d1904d651b66d1b20234ff1e46;hb=e03a836591446125527230ed150669943307832b;hpb=3496d4bf4d69213e9f211b64d63a54a63c9e5b16 diff --git a/src/PVE/Tools.pm b/src/PVE/Tools.pm index 0a7efeb..4a8b5d9 100644 --- a/src/PVE/Tools.pm +++ b/src/PVE/Tools.pm @@ -1596,4 +1596,16 @@ sub convert_size { return int($value); } +# uninterruptible readline +# retries on EINTR +sub readline_nointr { + my ($fh) = @_; + my $line; + while (1) { + $line = <$fh>; + last if defined($line) || ($! != EINTR); + } + return $line; +} + 1;