diff options
author | Michal Schmidt <mschmidt@redhat.com> | 2014-11-28 19:57:32 +0100 |
---|---|---|
committer | Michal Schmidt <mschmidt@redhat.com> | 2014-11-28 19:57:32 +0100 |
commit | 4a62c710b62a5a3c7a8a278b810b9d5b5a0c8f4f (patch) | |
tree | c7a6228e7151aa74bc8e331694a1e795226550cd /src/journal/journald-syslog.c | |
parent | 56f64d95763a799ba4475daf44d8e9f72a1bd474 (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-syslog.c')
-rw-r--r-- | src/journal/journald-syslog.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/src/journal/journald-syslog.c b/src/journal/journald-syslog.c index 51ebd8192d..cc44d45949 100644 --- a/src/journal/journald-syslog.c +++ b/src/journal/journald-syslog.c @@ -428,28 +428,22 @@ int server_open_syslog_socket(Server *s) { }; s->syslog_fd = socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0); - if (s->syslog_fd < 0) { - log_error_errno(errno, "socket() failed: %m"); - return -errno; - } + if (s->syslog_fd < 0) + return log_error_errno(errno, "socket() failed: %m"); unlink(sa.un.sun_path); r = bind(s->syslog_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->syslog_fd, 1); r = setsockopt(s->syslog_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()) { @@ -460,10 +454,8 @@ int server_open_syslog_socket(Server *s) { #endif r = setsockopt(s->syslog_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->syslog_event_source, s->syslog_fd, EPOLLIN, process_datagram, s); if (r < 0) |