|
From: | Aaron Jensen |
Subject: | bug#68083: 30.0.50; Intermittent build failure with native compilation |
Date: | Sat, 30 Dec 2023 14:54:53 -0600 |
From: Aaron Jensen <aaronjensen@gmail.com>
Date: Sat, 30 Dec 2023 13:06:55 -0500
Cc: acorallo@gnu.org, 68083@debbugs.gnu.org, jschmidt4gnu@vodafonemail.deOn Sat, Dec 30, 2023 at 12:43 PM Eli Zaretskii <eliz@gnu.org> wrote:
>
> What happens if, instead of wrapping rename-file in condition-case,
> you change that to say
>
> (t (if newfile
> (rename-file newfile oldfile)
> (delete-file oldfile))I don't really understand this change. The previous version of the code wraps the rename in a (when newfile) and deletes the oldfile right before that. The deletion would always be necessary if the oldfile exists unless OK-IF-ALREADY-EXISTS is specified in rename-file.
Sorry, I meant to add the OK-IF-ALREADY-EXISTS argument non-nil, of course.
The point is that you can rename a file if the OLDFILE exists with no problem, and that is supposed to be an atomic operation, so no race conditions.
Indeed, but we aren't specifying OK-IF-ALREADY-EXISTS, so if another process does the same compile at the same time (and therefore the same rename), they will conflict. We could specify OK-IF-ALREADY-EXISTS instead and that works as well:
Then I prefer this version.
[Prev in Thread] | Current Thread | [Next in Thread] |