Commit 5a2601d6 authored by Chrysostomos Nanakos's avatar Chrysostomos Nanakos

Fix kernel version detection in io_setup()

Tapdisk fails to start and exits silently after failing
to detect current kernel version. This happens only on newer
kernel versions missing sublevel field.
parent ee6cef8e
......@@ -254,8 +254,12 @@ int tapdisk_linux_version(void)
return -errno;
n = sscanf(uts.release, "%u.%u.%u", &version, &patchlevel, &sublevel);
if (n != 3)
return -ENOSYS;
if (n != 3) {
n = sscanf(uts.release, "%u.%u", &version, &patchlevel);
if (n != 2)
return -ENOSYS;
sublevel = 0;
}
return KERNEL_VERSION(version, patchlevel, sublevel);
}
......
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