Commit 5292b43b by Stéphane Graber Committed by GitHub

Merge pull request #1749 from brauner/2017-08-15/stable_1_0_cherry_picks

bdev: enable building with gcc7
parents 1f561a9f 9163a33b
......@@ -1917,6 +1917,8 @@ static int find_free_loopdev_no_control(int *retfd, char *namep)
}
while ((direntp = readdir(dir))) {
int ret;
if (!direntp)
break;
if (strncmp(direntp->d_name, "loop", 4) != 0)
......@@ -1930,7 +1932,11 @@ static int find_free_loopdev_no_control(int *retfd, char *namep)
continue;
}
// We can use this fd
snprintf(namep, 100, "/dev/%s", direntp->d_name);
ret = snprintf(namep, 100, "/dev/%s", direntp->d_name);
if (ret < 0 || ret >= 100) {
close(fd);
fd = -1;
}
break;
}
closedir(dir);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment