[pve-devel] applied: [PATCH storage] api: upload: correctly test for result of unlink
Thomas Lamprecht
t.lamprecht at proxmox.com
Thu Sep 12 12:13:06 CEST 2024
Am 29/07/2024 um 16:29 schrieb Fiona Ebner:
> It's not enough to check whether $! is set. From "perldoc perlvar":
>
>> Many system or library calls set "errno" if they fail, to
>> indicate the cause of failure. They usually do not set "errno"
>> to zero if they succeed and may set "errno" to a non-zero value
>> on success. This means "errno", hence $!, is meaningful only
>> *immediately* after a failure:
>
> To protect against potential issues, check the return value of unlink
> and only check $! if it failed.
>
> Signed-off-by: Fiona Ebner <f.ebner at proxmox.com>
> ---
> src/PVE/API2/Storage/Status.pm | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
>
applied, thanks!
More information about the pve-devel
mailing list