]> gitweb.factorcode.org Git - factor.git/commitdiff
alien.libraries.finder.linux: make ldconfig safe from runtime errors.
authorJohn Benediktsson <mrjbq7@gmail.com>
Tue, 13 Oct 2020 17:39:15 +0000 (10:39 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Tue, 13 Oct 2020 17:39:15 +0000 (10:39 -0700)
this helps on platforms like NixOS.

basis/alien/libraries/finder/linux/linux.factor

index 7af0f71c8a250a54236fb839addc5d47a12f1196..5dc314be9279289b49c44ba9c1f95842ce33e856 100644 (file)
@@ -25,8 +25,8 @@ CONSTANT: mach-map {
     ] map ;
 
 : load-ldconfig-cache ( -- seq )
-    "/sbin/ldconfig -p" utf8 [ lines ] with-process-reader
-    rest parse-ldconfig-lines ;
+    "/sbin/ldconfig -p" utf8 [ lines ] with-process-reader*
+    2drop [ f ] [ rest parse-ldconfig-lines ] if-empty ;
 
 : ldconfig-arch ( -- str )
     mach-map cpu of { "libc6" } or ;