@@ -32,6 +32,8 @@ (define-module (gnu installer utils)
#:use-module (ice-9 regex)
#:use-module (ice-9 format)
#:use-module (ice-9 textual-ports)
+ #:use-module (system foreign)
+ #:use-module (system foreign-library)
#:export (read-lines
read-all
nearest-exact-integer
@@ -143,6 +145,14 @@ (define* (run-external-command-with-handler handler command)
(match (primitive-fork)
(0 ;; We're in the child
(close-port input)
+ ;; XXX: Disable automatic finalization because we're going to exec.
+ ;; Might become unnecessary with newer Guile versions, as the
+ ;; *possible* finalization thread may stop properly when its pipe is
+ ;; closed.
+ ((foreign-library-function (load-foreign-library #f)
+ "scm_set_automatic_finalization_enabled"
+ #:return-type int
+ #:arg-types (list int)) 0)
(reset-fds
(open-fdes "/dev/null" O_WRONLY)
;; Avoid port GC'ing closing the fd by increasing its revealed count.