5
0
mirror of git://git.proxmox.com/git/pve-storage.git synced 2025-02-25 17:57:31 +03:00
Fiona Ebner 1fd1b53018 api: upload: correctly test for result of unlink
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@proxmox.com>
2024-09-12 12:12:49 +02:00
2024-06-21 13:56:32 +02:00
2021-11-09 17:02:29 +01:00
Description
No description provided
2.2 MiB
Languages
Perl 99.2%
Makefile 0.7%