summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2018-12-05 12:51:18 +0100
committerFlorian Dold <florian.dold@gmail.com>2018-12-05 12:51:18 +0100
commitf74d304fedd0d10a69b6b82e69d8deb5bec76d8a (patch)
tree5268d13162d701f8a0d4597ca2d6e7d5f6c9a7dd /guix
parentebbd5b4724e29635db4ea101f086d2fb71d3eb0b (diff)
downloaddeployment-f74d304fedd0d10a69b6b82e69d8deb5bec76d8a.tar.gz
deployment-f74d304fedd0d10a69b6b82e69d8deb5bec76d8a.tar.bz2
deployment-f74d304fedd0d10a69b6b82e69d8deb5bec76d8a.zip
cleanup
Diffstat (limited to 'guix')
-rw-r--r--guix/shepherd-with-sock.scm20
1 files changed, 11 insertions, 9 deletions
diff --git a/guix/shepherd-with-sock.scm b/guix/shepherd-with-sock.scm
index 8942181..a201c71 100644
--- a/guix/shepherd-with-sock.scm
+++ b/guix/shepherd-with-sock.scm
@@ -14,6 +14,16 @@
(define %pid-file-timeout (@@ (shepherd service) %pid-file-timeout))
+(define (clean-up-file file)
+ (when file
+ (catch 'system-error
+ (lambda ()
+ (delete-file file))
+ (lambda args
+ (unless (= ENOENT (system-error-errno args))
+ (apply throw args))))))
+
+
(define (open-service-stdin stdin-socket)
(define (get-sock pf af . addr)
(let ((sock (socket pf SOCK_STREAM 0)))
@@ -21,6 +31,7 @@
(fileno sock)))
(match stdin-socket
(('unix sockpath)
+ (clean-up-file sockpath)
(get-sock PF_UNIX AF_UNIX sockpath))
(('tcp addr port)
(get-sock PF_INET AF_INET (inet-pton AF_INET addr) port))
@@ -163,15 +174,6 @@ its PID."
pid)))
-(define (clean-up file)
- (when file
- (catch 'system-error
- (lambda ()
- (delete-file file))
- (lambda args
- (unless (= ENOENT (system-error-errno args))
- (apply throw args))))))
-
(define make-forkexec-constructor
(let ((warn-deprecated-form