guix-patches
[Top][All Lists]
Advanced

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

[bug#66387] [PATCH] home: services: Fix race condition when detecting fi


From: Carlo Zancanaro
Subject: [bug#66387] [PATCH] home: services: Fix race condition when detecting first login
Date: Tue, 10 Oct 2023 00:08:06 +1100
User-agent: mu4e 1.10.7; emacs 29.1

On Sat, Oct 07 2023, Carlo Zancanaro wrote:
@@ -412,20 +413,29 @@ (define (compute-on-first-login-script _ gexps)
      #~(begin
          (use-modules (guix i18n)
                       (guix diagnostics))
+
+       (define (claim-first-run file-name)
+         (catch #t
+           (lambda ()
+ ;; This incantation will raise an error if the file at + ;; flag-file-path already exists, and will create it otherwise.
+             (close (open file-name (logior O_CREAT O_EXCL)))
+             #t)
+           (lambda (e)

Whoops, just noticed this should be _, not (e). It still works, because it crashes the script which stops the gexps from running, but writes a message to the console. I'll send an updated patch tomorrow.





reply via email to

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