all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
blob 2fd97cc578edd7b98d3d1c0f4c380a0a730a0841 1619 bytes (raw)
name: gnu/packages/patches/shepherd-debug.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
 
diff --git a/modules/shepherd/service.scm b/modules/shepherd/service.scm
index 53437b6..bef8f42 100644
--- a/modules/shepherd/service.scm
+++ b/modules/shepherd/service.scm
@@ -715,21 +715,28 @@ number.  Return #f if FILE was not created or does not contain a number;
 otherwise return the number that was read (a PID)."
   (define start (current-time))
   (let loop ()
+    (define (retry)
+      (and (< (current-time) (+ start max-delay))
+           (begin
+             ;; FILE does not exist yet, so wait and try again.
+             ;; XXX: Ideally we would yield to the main event loop
+             ;; and/or use inotify.
+             (sleep 1)
+             (loop))))
+
     (catch 'system-error
       (lambda ()
-        (string->number
-         (string-trim-both
-          (call-with-input-file file get-string-all))))
+        (define str
+          (call-with-input-file file get-string-all))
+
+        (local-output (l10n "read-pid-file ~s -> ~s")
+                      file str)
+        (or (string->number (string-trim-both str))
+            (retry)))
       (lambda args
         (let ((errno (system-error-errno args)))
           (if (= ENOENT errno)
-              (and (< (current-time) (+ start max-delay))
-                   (begin
-                     ;; FILE does not exist yet, so wait and try again.
-                     ;; XXX: Ideally we would yield to the main event loop
-                     ;; and/or use inotify.
-                     (sleep 1)
-                     (loop)))
+              (retry)
               (apply throw args)))))))
 
 (define* (exec-command command

debug log:

solving 2fd97cc578 ...
found 2fd97cc578 in https://yhetil.org/guix/87k1f4y23d.fsf@gnu.org/

applying [1/1] https://yhetil.org/guix/87k1f4y23d.fsf@gnu.org/
diff --git a/gnu/packages/patches/shepherd-debug.patch b/gnu/packages/patches/shepherd-debug.patch
new file mode 100644
index 0000000000..2fd97cc578

1:48: trailing whitespace.
 
Checking patch gnu/packages/patches/shepherd-debug.patch...
Applied patch gnu/packages/patches/shepherd-debug.patch cleanly.
warning: 1 line adds whitespace errors.

index at:
100644 2fd97cc578edd7b98d3d1c0f4c380a0a730a0841	gnu/packages/patches/shepherd-debug.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

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.