]> xenbits.xensource.com Git - libvirt.git/commitdiff
audit: use bool for audit log choice
authorEric Blake <eblake@redhat.com>
Tue, 28 Oct 2014 19:07:09 +0000 (13:07 -0600)
committerEric Blake <eblake@redhat.com>
Wed, 29 Oct 2014 15:55:09 +0000 (09:55 -0600)
We weren't ever using the value for anything other than being non-zero.

* src/util/viraudit.h (virAuditLog): Change signature.
* src/util/viraudit.c (virAuditLog): Update user.
* daemon/libvirtd.c (main): Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
daemon/libvirtd.c
src/util/viraudit.c
src/util/viraudit.h

index 329d8d492b6446bc8bd6cd1d832769d9bcc25fe7..1864bfd4be36747cb7a139281f0c0099ced0a4c9 100644 (file)
@@ -1443,7 +1443,7 @@ int main(int argc, char **argv) {
             VIR_DEBUG("Proceeding without auditing");
         }
     }
-    virAuditLog(config->audit_logging);
+    virAuditLog(config->audit_logging > 0);
 
     /* setup the hooks if any */
     if (virHookInitialize() < 0) {
index 23928fda9a2496f496a839e941f2c29b514f320f..17e58b3a9574fbf033929c6193f224c7c9195870 100644 (file)
@@ -53,7 +53,7 @@ VIR_LOG_INIT("util.audit");
 #if WITH_AUDIT
 static int auditfd = -1;
 #endif
-static int auditlog = 0;
+static bool auditlog;
 
 int virAuditOpen(void)
 {
@@ -70,7 +70,7 @@ int virAuditOpen(void)
 }
 
 
-void virAuditLog(int logging)
+void virAuditLog(bool logging)
 {
     auditlog = logging;
 }
index 8101e50a63f65e37f7c1573dd4f235818faa93c6..861cbf691e8a40c2e36fb48fe22915b7a9ad5e64 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * viraudit.h: auditing support
  *
- * Copyright (C) 2010-2011 Red Hat, Inc.
+ * Copyright (C) 2010-2011, 2014 Red Hat, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -34,7 +34,7 @@ typedef enum {
 
 int virAuditOpen(void);
 
-void virAuditLog(int enabled);
+void virAuditLog(bool enabled);
 
 void virAuditSend(virLogSourcePtr source,
                   const char *filename, size_t linenr, const char *funcname,