From: Mathieu Othacehe <othacehe@gnu.org>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel@gnu.org
Subject: Re: 05/07: inferior: Fix concurrent cached-profile calls.
Date: Wed, 10 Mar 2021 13:13:05 +0100 [thread overview]
Message-ID: <87r1kn4372.fsf@gnu.org> (raw)
In-Reply-To: <87blbr7316.fsf@gnu.org> ("Ludovic Courtès"'s message of "Wed, 10 Mar 2021 10:48:21 +0100")
Hey Ludo,
> However, there’s already a (file-exists? cached) call a few lines
> above. So what you need instead is a TOCTTOU-free ‘symlink’, along
> these lines:
>
> (define (symlink/safe old new)
> (catch 'system-error
> (lambda ()
> (symlink old new))
> (lambda args
> (unless (= EEXIST (system-error-errno args))
> (apply throw args)))))
>
> ;; …
>
> (define symlink*
> (lift2 symlink/safe %store-monad))
>
> WDYT?
Fixed with a831ff6bc3f92ab4ecf6135e4d6386f14189ad06.
Thanks,
Mathieu
next prev parent reply other threads:[~2021-03-10 12:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20210310075017.12619.72665@vcs0.savannah.gnu.org>
[not found] ` <20210310075020.CC605211CF@vcs0.savannah.gnu.org>
2021-03-10 9:48 ` 05/07: inferior: Fix concurrent cached-profile calls Ludovic Courtès
2021-03-10 12:13 ` Mathieu Othacehe [this message]
[not found] ` <20210310075020.83E6A211CF@vcs0.savannah.gnu.org>
2021-03-10 9:57 ` 04/07: inferior: Break cached-channel-instance into two procedures Ludovic Courtès
2021-03-10 12:14 ` Mathieu Othacehe
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=87r1kn4372.fsf@gnu.org \
--to=othacehe@gnu.org \
--cc=guix-devel@gnu.org \
--cc=ludo@gnu.org \
/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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.