aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-03-06 19:35:58 +0000
committerandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-03-06 19:35:58 +0000
commit3bdf0f69c47673ce9ed6a07a76322284feaaabc4 (patch)
treecc3673d343ba9805836ec6c0cf61ebc75961da3b
parenta2b51950d4ad446b926928e8cb30737781de145f (diff)
downloadbusybox-w32-3bdf0f69c47673ce9ed6a07a76322284feaaabc4.tar.gz
busybox-w32-3bdf0f69c47673ce9ed6a07a76322284feaaabc4.tar.bz2
busybox-w32-3bdf0f69c47673ce9ed6a07a76322284feaaabc4.zip
Bug 1110 reported that the LOOP_GET_STATUS ioctl apparently returnes non-zero
error messages, contrary to the documentation. Whatever. This patch from zhaoway <zw@debian.org> looks safe enough. -Erik git-svn-id: svn://busybox.net/trunk/busybox@1983 69ca8d6d-28ef-0310-b511-8ec308f3f277
-rw-r--r--utility.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/utility.c b/utility.c
index 62af4a59f..2d27596e0 100644
--- a/utility.c
+++ b/utility.c
@@ -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);