bdev: enable building with gcc7

We shouldn't ignore this anyway. Signed-off-by: 's avatarChristian Brauner <christian.brauner@ubuntu.com>
parent 1f561a9f
......@@ -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