summaryrefslogtreecommitdiff
path: root/src/journal/journald-native.c
diff options
context:
space:
mode:
authorMichal Schmidt <mschmidt@redhat.com>2014-11-28 19:57:32 +0100
committerMichal Schmidt <mschmidt@redhat.com>2014-11-28 19:57:32 +0100
commit4a62c710b62a5a3c7a8a278b810b9d5b5a0c8f4f (patch)
treec7a6228e7151aa74bc8e331694a1e795226550cd /src/journal/journald-native.c
parent56f64d95763a799ba4475daf44d8e9f72a1bd474 (diff)
treewide: another round of simplifications
Using the same scripts as in f647962d64e "treewide: yet more log_*_errno + return simplifications".
Diffstat (limited to 'src/journal/journald-native.c')
-rw-r--r--src/journal/journald-native.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/src/journal/journald-native.c b/src/journal/journald-native.c
index a19f85d182..f982696255 100644
--- a/src/journal/journald-native.c
+++ b/src/journal/journald-native.c
@@ -424,28 +424,22 @@ int server_open_native_socket(Server*s) {
};
s->native_fd = socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0);
- if (s->native_fd < 0) {
- log_error_errno(errno, "socket() failed: %m");
- return -errno;
- }
+ if (s->native_fd < 0)
+ return log_error_errno(errno, "socket() failed: %m");
unlink(sa.un.sun_path);
r = bind(s->native_fd, &sa.sa, offsetof(union sockaddr_union, un.sun_path) + strlen(sa.un.sun_path));
- if (r < 0) {
- log_error_errno(errno, "bind(%s) failed: %m", sa.un.sun_path);
- return -errno;
- }
+ if (r < 0)
+ return log_error_errno(errno, "bind(%s) failed: %m", sa.un.sun_path);
chmod(sa.un.sun_path, 0666);
} else
fd_nonblock(s->native_fd, 1);
r = setsockopt(s->native_fd, SOL_SOCKET, SO_PASSCRED, &one, sizeof(one));
- if (r < 0) {
- log_error_errno(errno, "SO_PASSCRED failed: %m");
- return -errno;
- }
+ if (r < 0)
+ return log_error_errno(errno, "SO_PASSCRED failed: %m");
#ifdef HAVE_SELINUX
if (mac_selinux_use()) {
@@ -456,10 +450,8 @@ int server_open_native_socket(Server*s) {
#endif
r = setsockopt(s->native_fd, SOL_SOCKET, SO_TIMESTAMP, &one, sizeof(one));
- if (r < 0) {
- log_error_errno(errno, "SO_TIMESTAMP failed: %m");
- return -errno;
- }
+ if (r < 0)
+ return log_error_errno(errno, "SO_TIMESTAMP failed: %m");
r = sd_event_add_io(s->event, &s->native_event_source, s->native_fd, EPOLLIN, process_datagram, s);
if (r < 0)