summaryrefslogtreecommitdiffstats
path: root/mount/lomount.c
diff options
context:
space:
mode:
Diffstat (limited to 'mount/lomount.c')
-rw-r--r--mount/lomount.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/mount/lomount.c b/mount/lomount.c
index 6b102925f..d62198ef2 100644
--- a/mount/lomount.c
+++ b/mount/lomount.c
@@ -97,7 +97,11 @@ static int
is_loop_used(int fd)
{
struct loop_info li;
- return ioctl (fd, LOOP_GET_STATUS, &li) == 0;
+
+ errno = 0;
+ if (ioctl (fd, LOOP_GET_STATUS, &li) < 0 && errno == ENXIO)
+ return 0;
+ return 1;
}
static int