mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
util: Rename variable "major" in virIsDevMapperDevice
major() is a macro defined in sys/sysmacros.h so luckily the code works, but it's very confusing. Let's rename the local variable to make the difference between it and the macro more obvious. And while touching the line we can also initialize it to make sure "clever" analyzers do not think it may be used uninitialized. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Laine Stump <laine@redhat.com>
This commit is contained in:
parent
f07068d61c
commit
0c653fc9a5
@ -321,14 +321,14 @@ bool
|
||||
virIsDevMapperDevice(const char *dev_name)
|
||||
{
|
||||
struct stat buf;
|
||||
unsigned int major;
|
||||
unsigned int maj = 0;
|
||||
|
||||
if (virDevMapperGetMajor(&major) < 0)
|
||||
if (virDevMapperGetMajor(&maj) < 0)
|
||||
return false;
|
||||
|
||||
if (!stat(dev_name, &buf) &&
|
||||
S_ISBLK(buf.st_mode) &&
|
||||
major(buf.st_rdev) == major)
|
||||
major(buf.st_rdev) == maj)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user