mirror of
https://github.com/ceph/ceph
synced 2025-01-03 09:32:43 +00:00
filejournal: parse kernel version 3.0+
Signed-off-by: Sage Weil <sage@newdream.net>
This commit is contained in:
parent
3f708ee554
commit
bae40eaa96
@ -169,10 +169,13 @@ static int get_kernel_version(int *a, int *b, int *c)
|
||||
}
|
||||
|
||||
if (sscanf(buf, "Linux version %d.%d.%d", a, b, c) != 3) {
|
||||
derr << "get_kernel_version: failed to parse string: '"
|
||||
<< buf << "'" << dendl;
|
||||
ret = EIO;
|
||||
goto close_fd;
|
||||
if (sscanf(buf, "Linux version %d.%d", a, b) != 2) {
|
||||
derr << "get_kernel_version: failed to parse string: '"
|
||||
<< buf << "'" << dendl;
|
||||
ret = EIO;
|
||||
goto close_fd;
|
||||
}
|
||||
*c = 0;
|
||||
}
|
||||
|
||||
dout(0) << " kernel version is " << *a <<"." << *b << "." << *c << dendl;
|
||||
|
Loading…
Reference in New Issue
Block a user