OSDN Git Service

losetup: Fix loop mounting
authorGabriele M <moto.falcon.git@gmail.com>
Sun, 20 Nov 2016 21:04:36 +0000 (22:04 +0100)
committerGabriele M <moto.falcon.git@gmail.com>
Fri, 13 Jan 2017 21:17:13 +0000 (21:17 +0000)
Vold creates the loop blocks in /dev/block.

Change-Id: Ie926ce672deae4a3494aad2ea19d44d7be60ec97
(cherry picked from commit c3a5a80fdea07f47295c92b279729d4baa730402)

toys/other/losetup.c

index 4e467a9..6b0a757 100644 (file)
@@ -76,7 +76,7 @@ static void loopback_setup(char *device, char *file)
     // mount -o loop depends on found device being at the start of toybuf.
     if (cfd != -1) {
       if (0 <= (i = ioctl(cfd, 0x4C82))) // LOOP_CTL_GET_FREE
-        sprintf(device = toybuf, "/dev/loop%d", i);
+        sprintf(device = toybuf, "/dev/block/loop%d", i);
       close(cfd);
     }
   }