diff options
-rw-r--r-- | utility.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1507,7 +1507,7 @@ extern char *find_unused_loop_device(void) | |||
1507 | sprintf(dev, "/dev/loop%d", i); | 1507 | sprintf(dev, "/dev/loop%d", i); |
1508 | if (stat(dev, &statbuf) == 0 && S_ISBLK(statbuf.st_mode)) { | 1508 | if (stat(dev, &statbuf) == 0 && S_ISBLK(statbuf.st_mode)) { |
1509 | if ((fd = open(dev, O_RDONLY)) >= 0) { | 1509 | if ((fd = open(dev, O_RDONLY)) >= 0) { |
1510 | if (ioctl(fd, LOOP_GET_STATUS, &loopinfo) == -1) { | 1510 | if (ioctl(fd, LOOP_GET_STATUS, &loopinfo) != 0) { |
1511 | if (errno == ENXIO) { /* probably free */ | 1511 | if (errno == ENXIO) { /* probably free */ |
1512 | close(fd); | 1512 | close(fd); |
1513 | return strdup(dev); | 1513 | return strdup(dev); |