chiark / gitweb /
umount: assume that a non-existing /dev/loop device means it is already detached
authorLennart Poettering <lennart@poettering.net>
Mon, 14 Mar 2011 04:37:47 +0000 (05:37 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 14 Mar 2011 14:37:09 +0000 (15:37 +0100)
src/umount.c

index 4fd6b22..6fe0a26 100644 (file)
@@ -355,7 +355,7 @@ static int delete_loopback(const char *device) {
         int fd, r;
 
         if ((fd = open(device, O_RDONLY|O_CLOEXEC)) < 0)
-                return -errno;
+                return errno == ENOENT ? 0 : -errno;
 
         r = ioctl(fd, LOOP_CLR_FD, 0);
         close_nointr_nofail(fd);