util: ensure min/maj are initialized in virGetDeviceID

The stub impl of virGetDeviceID just returns ENOSYS and does not
initialize the min/maj output parameters. This lead to a false
positive warning on mingw about possible use of uninitialized
variables.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé 2020-03-12 18:39:35 +00:00
parent 46e16b553d
commit 0a815baf2f

View File

@ -1407,9 +1407,10 @@ virGetDeviceID(const char *path, int *maj, int *min)
#else
int
virGetDeviceID(const char *path G_GNUC_UNUSED,
int *maj G_GNUC_UNUSED,
int *min G_GNUC_UNUSED)
int *maj,
int *min)
{
*maj = *min = 0;
return -ENOSYS;
}
#endif