]> xenbits.xensource.com Git - libvirt.git/commitdiff
util: Fix virDoes*Exist return type
authorMartin Kletzander <mkletzan@redhat.com>
Mon, 19 Nov 2018 21:31:01 +0000 (22:31 +0100)
committerMartin Kletzander <mkletzan@redhat.com>
Tue, 20 Nov 2018 08:32:12 +0000 (09:32 +0100)
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>
src/util/virutil.c
src/util/virutil.h

index c0783ecb285bd5b8142e0d0f695415bf9bb2dc02..974cffc2eeb74a93407211969020c4143d5dbd0d 100644 (file)
@@ -1133,7 +1133,7 @@ virGetGroupID(const char *group, gid_t *gid)
 /* Silently checks if User @name exists.
  * Returns if the user exists and fallbacks to false on error.
  */
-int
+bool
 virDoesUserExist(const char *name)
 {
     return virGetUserIDByName(name, NULL, true) == 0;
@@ -1142,7 +1142,7 @@ virDoesUserExist(const char *name)
 /* Silently checks if Group @name exists.
  * Returns if the group exists and fallbacks to false on error.
  */
-int
+bool
 virDoesGroupExist(const char *name)
 {
     return virGetGroupIDByName(name, NULL, true) == 0;
@@ -1243,16 +1243,16 @@ virGetGroupList(uid_t uid ATTRIBUTE_UNUSED, gid_t gid ATTRIBUTE_UNUSED,
     return 0;
 }
 
-int
+bool
 virDoesUserExist(const char *name ATTRIBUTE_UNUSED)
 {
-    return 0;
+    return false;
 }
 
-int
+bool
 virDoesGroupExist(const char *name ATTRIBUTE_UNUSED)
 {
-    return 0;
+    return false;
 }
 
 # ifdef WIN32
index 2407f54efd4729178fbb8fdb27cd1d0719ae6499..e0ab0da0f2fc0a03c197179c485afb59b46992dc 100644 (file)
@@ -152,8 +152,8 @@ int virGetUserID(const char *name,
 int virGetGroupID(const char *name,
                   gid_t *gid) ATTRIBUTE_RETURN_CHECK;
 
-int virDoesUserExist(const char *name);
-int virDoesGroupExist(const char *name);
+bool virDoesUserExist(const char *name);
+bool virDoesGroupExist(const char *name);
 
 
 bool virIsDevMapperDevice(const char *dev_name) ATTRIBUTE_NONNULL(1);