From 3bdf0f69c47673ce9ed6a07a76322284feaaabc4 Mon Sep 17 00:00:00 2001 From: andersen Date: Tue, 6 Mar 2001 19:35:58 +0000 Subject: Bug 1110 reported that the LOOP_GET_STATUS ioctl apparently returnes non-zero error messages, contrary to the documentation. Whatever. This patch from zhaoway looks safe enough. -Erik git-svn-id: svn://busybox.net/trunk/busybox@1983 69ca8d6d-28ef-0310-b511-8ec308f3f277 --- utility.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) sprintf(dev, "/dev/loop%d", i); if (stat(dev, &statbuf) == 0 && S_ISBLK(statbuf.st_mode)) { if ((fd = open(dev, O_RDONLY)) >= 0) { - if (ioctl(fd, LOOP_GET_STATUS, &loopinfo) == -1) { + if (ioctl(fd, LOOP_GET_STATUS, &loopinfo) != 0) { if (errno == ENXIO) { /* probably free */ close(fd); return strdup(dev); -- cgit v1.2.3-55-g6feb