]> git.proxmox.com Git - pve-common.git/commit
read firstline: only map ENOENT to undef, raise error otherwise
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 13 Jun 2023 05:12:06 +0000 (07:12 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 13 Jun 2023 05:16:40 +0000 (07:16 +0200)
commit1ac0a30a0a939609aaffe7a59837048f9e8a8c05
treefef991b0a12b9d82500ff72031e0b1765164f9bf
parentaa4898ebbe65f438cd72824d7bb86442404c37e2
read firstline: only map ENOENT to undef, raise error otherwise

Errors like permission denied or I/O ones should bubble up, otherwise
it might hide serious issues and seemingly continue to work, with a
wrong state or the like.

One could argue that the case for not existent should return undef,
while an empty file should return an empty string, but for that we
might want to check all use-sites first.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/Tools.pm