syscalls: 'device-in-use?' does not create a port.
* guix/build/syscalls.scm (device-in-use?): Use 'open-fdes' rather than 'open-file'.
This commit is contained in:
parent
f40728f9d6
commit
a1f5dfc202
|
@ -693,9 +693,9 @@ (define* (device-in-use? device)
|
||||||
from fdisk_device_is_used function of util-linux. This is particulary useful
|
from fdisk_device_is_used function of util-linux. This is particulary useful
|
||||||
for devices that do not appear in /proc/self/mounts like overlayfs lowerdir
|
for devices that do not appear in /proc/self/mounts like overlayfs lowerdir
|
||||||
backend device."
|
backend device."
|
||||||
(let*-values (((port) (open-file device "rb"))
|
(let*-values (((fd) (open-fdes device O_RDONLY))
|
||||||
((ret err) (%ioctl (fileno port) BLKRRPART %null-pointer)))
|
((ret err) (%ioctl fd BLKRRPART %null-pointer)))
|
||||||
(close-port port)
|
(close-fdes fd)
|
||||||
(cond
|
(cond
|
||||||
((= ret 0)
|
((= ret 0)
|
||||||
#f)
|
#f)
|
||||||
|
|
Loading…
Reference in a new issue