guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 05/07: inferior: Fix concurrent cached-profile calls.


From: Mathieu Othacehe
Subject: Re: 05/07: inferior: Fix concurrent cached-profile calls.
Date: Wed, 10 Mar 2021 13:13:05 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]