summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen2001-03-06 19:35:58 +0000
committerEric Andersen2001-03-06 19:35:58 +0000
commit1a046d5f9dd627711a6d212963beae3354b68374 (patch)
treecc3673d343ba9805836ec6c0cf61ebc75961da3b
parent138ece09b5993debb472aa590999ae2221973f5a (diff)
downloadbusybox-1a046d5f9dd627711a6d212963beae3354b68374.zip
busybox-1a046d5f9dd627711a6d212963beae3354b68374.tar.gz
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
-rw-r--r--utility.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/utility.c b/utility.c
index 62af4a5..2d27596 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);