From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
Fiona Ebner <f.ebner@proxmox.com>
Subject: Re: [pve-devel] [PATCH storage] api: upload: correctly test for result of unlink
Date: Mon, 29 Jul 2024 18:50:26 +0200 [thread overview]
Message-ID: <098ccae5-6efa-4898-9ca0-f8478f43959d@proxmox.com> (raw)
In-Reply-To: <20240729142956.58257-1-f.ebner@proxmox.com>
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.
fine by me, but out of interest: any reason for why this is done now,
i.e., did this really cause trouble or is this done out of precaution?
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
next prev parent reply other threads:[~2024-07-29 16:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-29 14:29 Fiona Ebner
2024-07-29 16:50 ` Thomas Lamprecht [this message]
2024-07-30 8:21 ` Fiona Ebner
2024-09-12 10:13 ` [pve-devel] applied: " Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=098ccae5-6efa-4898-9ca0-f8478f43959d@proxmox.com \
--to=t.lamprecht@proxmox.com \
--cc=f.ebner@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox