mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-25 13:58:15 -05:00
ui: 'with-profile-lock' keeps going upon ENOLCK.
* guix/build/syscalls.scm (call-with-file-lock/no-wait): Really pass ARGS to HANDLER. Return #f when HANDLER is called. * guix/ui.scm (profile-lock-handler): Emit a mere warning upon ENOLCK.
This commit is contained in:
parent
55e1dfa4dd
commit
3f8e890d91
2 changed files with 10 additions and 3 deletions
|
@ -1127,7 +1127,9 @@ (define (call-with-file-lock/no-wait file thunk handler)
|
||||||
(lambda (key . args)
|
(lambda (key . args)
|
||||||
(match key
|
(match key
|
||||||
('flock-error
|
('flock-error
|
||||||
(handler args))
|
(apply handler args)
|
||||||
|
;; No open port to the lock, so return #f.
|
||||||
|
#f)
|
||||||
('system-error
|
('system-error
|
||||||
;; When using the statically-linked Guile in the initrd,
|
;; When using the statically-linked Guile in the initrd,
|
||||||
;; 'fcntl-flock' returns ENOSYS unconditionally. Ignore
|
;; 'fcntl-flock' returns ENOSYS unconditionally. Ignore
|
||||||
|
|
|
@ -1666,8 +1666,13 @@ (define (display-diff profile old new)
|
||||||
|
|
||||||
(define (profile-lock-handler profile errno . _)
|
(define (profile-lock-handler profile errno . _)
|
||||||
"Handle failure to acquire PROFILE's lock."
|
"Handle failure to acquire PROFILE's lock."
|
||||||
(leave (G_ "profile ~a is locked by another process~%")
|
;; NFS mounts can return ENOLCK. When that happens, there's not much that
|
||||||
profile))
|
;; can be done, so warn the user and keep going.
|
||||||
|
(if (= errno ENOLCK)
|
||||||
|
(warning (G_ "cannot lock profile ~a: ~a~%")
|
||||||
|
profile (strerror errno))
|
||||||
|
(leave (G_ "profile ~a is locked by another process~%")
|
||||||
|
profile)))
|
||||||
|
|
||||||
(define profile-lock-file
|
(define profile-lock-file
|
||||||
(cut string-append <> ".lock"))
|
(cut string-append <> ".lock"))
|
||||||
|
|
Loading…
Reference in a new issue