summary refs log tree commit diff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2019-01-16 16:16:24 +0100
committerLudovic Courtès <ludo@gnu.org>2019-01-17 14:04:27 +0100
commita1f5dfc202f831b5e1cac4fbec9c27ae897c069f (patch)
treeecd2d1adf37ad4f65c525c5d153f9008a54c16b6
parentf40728f9d65fcff4ca289d5c9642194e60d369d3 (diff)
downloadguix-a1f5dfc202f831b5e1cac4fbec9c27ae897c069f.tar.gz
syscalls: 'device-in-use?' does not create a port.
* guix/build/syscalls.scm (device-in-use?): Use 'open-fdes' rather than
'open-file'.
-rw-r--r--guix/build/syscalls.scm6
1 files changed, 3 insertions, 3 deletions
diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm
index 6f2a061f35..94d335b67c 100644
--- a/guix/build/syscalls.scm
+++ b/guix/build/syscalls.scm
@@ -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)