summaryrefslogtreecommitdiff
path: root/src/activate
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/activate
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/activate')
-rw-r--r--src/activate/activate.c18
1 files changed, 6 insertions, 12 deletions
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) {