From 4a62c710b62a5a3c7a8a278b810b9d5b5a0c8f4f Mon Sep 17 00:00:00 2001 From: Michal Schmidt Date: Fri, 28 Nov 2014 19:57:32 +0100 Subject: treewide: another round of simplifications Using the same scripts as in f647962d64e "treewide: yet more log_*_errno + return simplifications". --- src/activate/activate.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'src/activate') diff --git a/src/activate/activate.c b/src/activate/activate.c index 3b4cb1e7f5..2689934c40 100644 --- a/src/activate/activate.c +++ b/src/activate/activate.c @@ -51,10 +51,8 @@ static int add_epoll(int epoll_fd, int fd) { ev.data.fd = fd; r = epoll_ctl(epoll_fd, EPOLL_CTL_ADD, fd, &ev); - if (r < 0) { - log_error_errno(errno, "Failed to add event on epoll fd:%d for fd:%d: %m", epoll_fd, fd); - return -errno; - } + if (r < 0) + return log_error_errno(errno, "Failed to add event on epoll fd:%d for fd:%d: %m", epoll_fd, fd); return 0; } @@ -111,10 +109,8 @@ static int open_sockets(int *epoll_fd, bool accept) { log_open(); *epoll_fd = epoll_create1(EPOLL_CLOEXEC); - if (*epoll_fd < 0) { - log_error_errno(errno, "Failed to create epoll object: %m"); - return -errno; - } + if (*epoll_fd < 0) + return log_error_errno(errno, "Failed to create epoll object: %m"); for (fd = SD_LISTEN_FDS_START; fd < SD_LISTEN_FDS_START + count; fd++) { _cleanup_free_ char *name = NULL; @@ -192,10 +188,8 @@ static int launch1(const char* child, char** argv, char **env, int fd) { parent_pid = getpid(); child_pid = fork(); - if (child_pid < 0) { - log_error_errno(errno, "Failed to fork: %m"); - return -errno; - } + if (child_pid < 0) + return log_error_errno(errno, "Failed to fork: %m"); /* In the child */ if (child_pid == 0) { -- cgit v1.2.3-54-g00ecf