mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 15:36:20 -05:00
services: dhcp-client: Use 'read-pid-file'.
* gnu/services/networking.scm (dhcp-client-service-type)[start]: Use 'read-pid-file' instead of the custom and possibly infinite loop.
This commit is contained in:
parent
2a5f2b1f75
commit
6f03b08089
1 changed files with 2 additions and 14 deletions
|
@ -1,5 +1,5 @@
|
|||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
|
||||
;;; Copyright © 2016, 2018 Efraim Flashner <efraim@flashner.co.il>
|
||||
;;; Copyright © 2016 John Darrington <jmd@gnu.org>
|
||||
|
@ -191,19 +191,7 @@ (define ifaces
|
|||
(cons* #$dhclient "-nw"
|
||||
"-pf" #$pid-file ifaces))))
|
||||
(and (zero? (cdr (waitpid pid)))
|
||||
(let loop ()
|
||||
(catch 'system-error
|
||||
(lambda ()
|
||||
(call-with-input-file #$pid-file read))
|
||||
(lambda args
|
||||
;; 'dhclient' returned before PID-FILE was created,
|
||||
;; so try again.
|
||||
(let ((errno (system-error-errno args)))
|
||||
(if (= ENOENT errno)
|
||||
(begin
|
||||
(sleep 1)
|
||||
(loop))
|
||||
(apply throw args))))))))))
|
||||
(read-pid-file #$pid-file)))))
|
||||
(stop #~(make-kill-destructor))))))
|
||||
|
||||
(define* (dhcp-client-service #:key (dhcp isc-dhcp))
|
||||
|
|
Loading…
Reference in a new issue