chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sd-icmp6-nd: Update Router Advertisement handling
[elogind.git]
/
src
/
core
/
audit-fd.c
diff --git
a/src/core/audit-fd.c
b/src/core/audit-fd.c
index 0a8626fbc29462b83c124a148016050dfe232c10..5a18e263a85e80fde448fe4b6ce34a5d63869a73 100644
(file)
--- a/
src/core/audit-fd.c
+++ b/
src/core/audit-fd.c
@@
-19,16
+19,18
@@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <stdbool.h>
-#include <errno.h>
+#include <errno.h>
#include "audit-fd.h"
#include "audit-fd.h"
-#include "log.h"
#ifdef HAVE_AUDIT
#ifdef HAVE_AUDIT
+#include <stdbool.h>
#include <libaudit.h>
#include <libaudit.h>
+#include "log.h"
+#include "util.h"
+
static bool initialized = false;
static int audit_fd;
static bool initialized = false;
static int audit_fd;
@@
-39,7
+41,7
@@
int get_audit_fd(void) {
if (audit_fd < 0) {
if (errno != EAFNOSUPPORT && errno != EPROTONOSUPPORT)
if (audit_fd < 0) {
if (errno != EAFNOSUPPORT && errno != EPROTONOSUPPORT)
- log_error
(
"Failed to connect to audit log: %m");
+ log_error
_errno(errno,
"Failed to connect to audit log: %m");
audit_fd = errno ? -errno : -EINVAL;
}
audit_fd = errno ? -errno : -EINVAL;
}
@@
-53,7
+55,7
@@
int get_audit_fd(void) {
void close_audit_fd(void) {
if (initialized && audit_fd >= 0)
void close_audit_fd(void) {
if (initialized && audit_fd >= 0)
-
close_nointr_nofail
(audit_fd);
+
safe_close
(audit_fd);
initialized = true;
audit_fd = -ECONNRESET;
initialized = true;
audit_fd = -ECONNRESET;