1
0

Convert HAVE_AUDIT to WITH_AUDIT

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrange 2012-09-20 13:00:09 +01:00
parent c45fed8a63
commit e424220a0e
2 changed files with 9 additions and 9 deletions

View File

@ -1258,13 +1258,13 @@ if test "$with_audit" != "no" ; then
if test "$with_audit" = "yes" ; then if test "$with_audit" = "yes" ; then
AUDIT_LIBS="$AUDIT_LIBS -laudit" AUDIT_LIBS="$AUDIT_LIBS -laudit"
AC_DEFINE_UNQUOTED([HAVE_AUDIT], 1, [whether libaudit is available]) AC_DEFINE_UNQUOTED([WITH_AUDIT], 1, [whether libaudit is available])
fi fi
CFLAGS="$old_cflags" CFLAGS="$old_cflags"
LIBS="$old_libs" LIBS="$old_libs"
fi fi
AM_CONDITIONAL([HAVE_AUDIT], [test "$with_audit" = "yes"]) AM_CONDITIONAL([WITH_AUDIT], [test "$with_audit" = "yes"])
AC_SUBST([AUDIT_CFLAGS]) AC_SUBST([AUDIT_CFLAGS])
AC_SUBST([AUDIT_LIBS]) AC_SUBST([AUDIT_LIBS])

View File

@ -21,7 +21,7 @@
#include <config.h> #include <config.h>
#ifdef HAVE_AUDIT #ifdef WITH_AUDIT
# include <libaudit.h> # include <libaudit.h>
#endif #endif
#include <stdio.h> #include <stdio.h>
@ -48,14 +48,14 @@
#define VIR_FROM_THIS VIR_FROM_AUDIT #define VIR_FROM_THIS VIR_FROM_AUDIT
#if HAVE_AUDIT #if WITH_AUDIT
static int auditfd = -1; static int auditfd = -1;
#endif #endif
static int auditlog = 0; static int auditlog = 0;
int virAuditOpen(void) int virAuditOpen(void)
{ {
#if HAVE_AUDIT #if WITH_AUDIT
if ((auditfd = audit_open()) < 0) { if ((auditfd = audit_open()) < 0) {
virReportSystemError(errno, "%s", _("Unable to initialize audit layer")); virReportSystemError(errno, "%s", _("Unable to initialize audit layer"));
return -1; return -1;
@ -87,7 +87,7 @@ void virAuditSend(const char *filename,
/* Duplicate later checks, to short circuit & avoid printf overhead /* Duplicate later checks, to short circuit & avoid printf overhead
* when nothing is enabled */ * when nothing is enabled */
#if HAVE_AUDIT #if WITH_AUDIT
if (!auditlog && auditfd < 0) if (!auditlog && auditfd < 0)
return; return;
#else #else
@ -113,7 +113,7 @@ void virAuditSend(const char *filename,
NULL, "success=no %s", str); NULL, "success=no %s", str);
} }
#if HAVE_AUDIT #if WITH_AUDIT
if (auditfd < 0) { if (auditfd < 0) {
VIR_FREE(str); VIR_FREE(str);
return; return;
@ -141,14 +141,14 @@ void virAuditSend(const char *filename,
void virAuditClose(void) void virAuditClose(void)
{ {
#if HAVE_AUDIT #if WITH_AUDIT
VIR_FORCE_CLOSE(auditfd); VIR_FORCE_CLOSE(auditfd);
#endif #endif
} }
char *virAuditEncode(const char *key, const char *value) char *virAuditEncode(const char *key, const char *value)
{ {
#if HAVE_AUDIT #if WITH_AUDIT
return audit_encode_nv_string(key, value, 0); return audit_encode_nv_string(key, value, 0);
#else #else
char *str; char *str;