syscalls: 'device-in-use?' does not create a port.

* guix/build/syscalls.scm (device-in-use?): Use 'open-fdes' rather than
'open-file'.
master
Ludovic Courtès 2019-01-16 16:16:24 +01:00
parent f40728f9d6
commit a1f5dfc202
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 3 additions and 3 deletions

View File

@ -693,9 +693,9 @@ mounted at FILE."
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
backend device."
(let*-values (((port) (open-file device "rb"))
((ret err) (%ioctl (fileno port) BLKRRPART %null-pointer)))
(close-port port)
(let*-values (((fd) (open-fdes device O_RDONLY))
((ret err) (%ioctl fd BLKRRPART %null-pointer)))
(close-fdes fd)
(cond
((= ret 0)
#f)