mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-08 20:51:26 +00:00
util: Fix virDoes*Exist return type
Since the functions only return 0 or 1, they should return bool. I missed the change when "refactoring" the first commit. Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
parent
615106fb10
commit
88a109a17d
@ -1133,7 +1133,7 @@ virGetGroupID(const char *group, gid_t *gid)
|
|||||||
/* Silently checks if User @name exists.
|
/* Silently checks if User @name exists.
|
||||||
* Returns if the user exists and fallbacks to false on error.
|
* Returns if the user exists and fallbacks to false on error.
|
||||||
*/
|
*/
|
||||||
int
|
bool
|
||||||
virDoesUserExist(const char *name)
|
virDoesUserExist(const char *name)
|
||||||
{
|
{
|
||||||
return virGetUserIDByName(name, NULL, true) == 0;
|
return virGetUserIDByName(name, NULL, true) == 0;
|
||||||
@ -1142,7 +1142,7 @@ virDoesUserExist(const char *name)
|
|||||||
/* Silently checks if Group @name exists.
|
/* Silently checks if Group @name exists.
|
||||||
* Returns if the group exists and fallbacks to false on error.
|
* Returns if the group exists and fallbacks to false on error.
|
||||||
*/
|
*/
|
||||||
int
|
bool
|
||||||
virDoesGroupExist(const char *name)
|
virDoesGroupExist(const char *name)
|
||||||
{
|
{
|
||||||
return virGetGroupIDByName(name, NULL, true) == 0;
|
return virGetGroupIDByName(name, NULL, true) == 0;
|
||||||
@ -1243,16 +1243,16 @@ virGetGroupList(uid_t uid ATTRIBUTE_UNUSED, gid_t gid ATTRIBUTE_UNUSED,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
bool
|
||||||
virDoesUserExist(const char *name ATTRIBUTE_UNUSED)
|
virDoesUserExist(const char *name ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
return 0;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
bool
|
||||||
virDoesGroupExist(const char *name ATTRIBUTE_UNUSED)
|
virDoesGroupExist(const char *name ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
return 0;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
# ifdef WIN32
|
# ifdef WIN32
|
||||||
|
@ -152,8 +152,8 @@ int virGetUserID(const char *name,
|
|||||||
int virGetGroupID(const char *name,
|
int virGetGroupID(const char *name,
|
||||||
gid_t *gid) ATTRIBUTE_RETURN_CHECK;
|
gid_t *gid) ATTRIBUTE_RETURN_CHECK;
|
||||||
|
|
||||||
int virDoesUserExist(const char *name);
|
bool virDoesUserExist(const char *name);
|
||||||
int virDoesGroupExist(const char *name);
|
bool virDoesGroupExist(const char *name);
|
||||||
|
|
||||||
|
|
||||||
bool virIsDevMapperDevice(const char *dev_name) ATTRIBUTE_NONNULL(1);
|
bool virIsDevMapperDevice(const char *dev_name) ATTRIBUTE_NONNULL(1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user