file-systems: Gracefully handle EMEDIUMTYPE in 'read-partitions'.

* gnu/build/file-systems.scm (ENOENT-safe): Catch EMEDIUMTYPE and warn.
This commit is contained in:
Marius Bakke 2022-10-31 11:23:43 +01:00
parent 706f25f24d
commit c1261b3a5d
No known key found for this signature in database
GPG key ID: A2A06DF2A33A54FA

View file

@ -899,6 +899,10 @@ (define (ENOENT-safe proc)
(format (current-error-port) (format (current-error-port)
"warning: failed to read from device '~a'~%" device) "warning: failed to read from device '~a'~%" device)
#f) #f)
((= EMEDIUMTYPE errno) ;inaccessible, like DRBD secondaries
(format (current-error-port)
"warning: failed to open device '~a'~%" device)
#f)
(else (else
(apply throw args)))))))) (apply throw args))))))))