#include "bsm_audit.h"
+/*
+ * Solaris auditon() returns EINVAL if BSM audit not configured.
+ * OpenBSM returns ENOSYS for unimplemented options.
+ */
+#ifdef __sun__
+# define AUDIT_NOT_CONFIGURED EINVAL
+#else
+# define AUDIT_NOT_CONFIGURED ENOSYS
+#endif
+
void log_error(int flags, const char *fmt, ...) __attribute__((__noreturn__));
static int
* If we are not auditing, don't cut an audit record; just return.
*/
if (auditon(A_GETCOND, (caddr_t)&au_cond, sizeof(long)) < 0) {
- if (errno == ENOSYS)
+ if (errno == AUDIT_NOT_CONFIGURED)
return;
log_error(0, "Could not determine audit condition");
}
* If we are not auditing, don't cut an audit record; just return.
*/
if (auditon(A_GETCOND, &au_cond, sizeof(long)) < 0) {
- if (errno == ENOSYS)
+ if (errno == AUDIT_NOT_CONFIGURED)
return;
log_error(0, "Could not determine audit condition");
}