Browse code

devmapper: Fix loopback mount code

Typo in the loop-control code made it always fall back to the
old method of opening loopback devices.

Alexander Larsson authored on 2013/09/19 21:39:47
Showing 1 changed files
... ...
@@ -27,7 +27,7 @@ attach_loop_device(const char *filename, int *loop_fd_out)
27 27
 
28 28
   start_index = 0;
29 29
   fd = open("/dev/loop-control", O_RDONLY);
30
-  if (fd == 0) {
30
+  if (fd >= 0) {
31 31
     start_index = ioctl(fd, LOOP_CTL_GET_FREE);
32 32
     close(fd);
33 33