summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
138ece0)
error messages, contrary to the documentation. Whatever. This patch from
zhaoway <zw@debian.org> looks safe enough.
-Erik
sprintf(dev, "/dev/loop%d", i);
if (stat(dev, &statbuf) == 0 && S_ISBLK(statbuf.st_mode)) {
if ((fd = open(dev, O_RDONLY)) >= 0) {
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);
if (errno == ENXIO) { /* probably free */
close(fd);
return strdup(dev);