This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [PATCH] PR libstdc++/83626 Don't throw for remove("") and remove_all("")
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: Tim Song <t dot canens dot cpp at gmail dot com>
- Cc: libstdc++ <libstdc++ at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 5 Jan 2018 10:37:35 +0000
- Subject: Re: [PATCH] PR libstdc++/83626 Don't throw for remove("") and remove_all("")
- Authentication-results: sourceware.org; auth=none
- References: <20180104230027.GA24800@redhat.com> <CAPQZVxu=h18ZEPrR77yG78UF_eKcS+Ya5AZfMeC+_E-uQM_Arg@mail.gmail.com>
On 04/01/18 21:02 -0500, Tim Song wrote:
What if the file to be removed is externally removed between the
symlink_status and the ::remove call? This is probably QoI because
filesystem race, but it seems reasonable to double check errno if
::remove fails and not fail if the failure is due to the file not
existing.
Yes, the race makes it undefined, but checking for ENOENT seems
reasonable. Thanks for the suggestion.