guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

65/68: syscalls: 'device-in-use?' returns #f upon EINVAL.


From: guix-commits
Subject: 65/68: syscalls: 'device-in-use?' returns #f upon EINVAL.
Date: Thu, 17 Jan 2019 08:05:22 -0500 (EST)

civodul pushed a commit to branch master
in repository guix.

commit 077589459c1c3ce4cb690447d82b75a46712f896
Author: Ludovic Courtès <address@hidden>
Date:   Wed Jan 16 17:43:52 2019 +0100

    syscalls: 'device-in-use?' returns #f upon EINVAL.
    
    This mirrors the behavior of the 'fdisk_device_is_used' function of
    util-linux.
    
    * guix/build/syscalls.scm (device-in-use?): Return #f upon EINVAL.
---
 guix/build/syscalls.scm | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm
index 94d335b..66d63a2 100644
--- a/guix/build/syscalls.scm
+++ b/guix/build/syscalls.scm
@@ -701,6 +701,11 @@ backend device."
       #f)
      ((= err EBUSY)
       #t)
+     ((= err EINVAL)
+      ;; We get EINVAL for devices that have the GENHD_FL_NO_PART_SCAN flag
+      ;; set in the kernel, in particular loopback devices, though we do seem
+      ;; to get it for SCSI storage (/dev/sr0) on QEMU.
+      #f)
      (else
       (throw 'system-error "ioctl" "~A"
              (list (strerror err))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]