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/socket-proxy | |
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/socket-proxy')
-rw-r--r-- | src/socket-proxy/socket-proxyd.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/src/socket-proxy/socket-proxyd.c b/src/socket-proxy/socket-proxyd.c index a2507ad456..a3c3c87f11 100644 --- a/src/socket-proxy/socket-proxyd.c +++ b/src/socket-proxy/socket-proxyd.c @@ -120,18 +120,14 @@ static int connection_create_pipes(Connection *c, int buffer[2], size_t *sz) { return 0; r = pipe2(buffer, O_CLOEXEC|O_NONBLOCK); - if (r < 0) { - log_error_errno(errno, "Failed to allocate pipe buffer: %m"); - return -errno; - } + if (r < 0) + return log_error_errno(errno, "Failed to allocate pipe buffer: %m"); (void) fcntl(buffer[0], F_SETPIPE_SZ, BUFFER_SIZE); r = fcntl(buffer[0], F_GETPIPE_SZ); - if (r < 0) { - log_error_errno(errno, "Failed to get pipe buffer size: %m"); - return -errno; - } + if (r < 0) + return log_error_errno(errno, "Failed to get pipe buffer size: %m"); assert(r > 0); *sz = r; @@ -171,10 +167,8 @@ static int connection_shovel( } else if (z == 0 || errno == EPIPE || errno == ECONNRESET) { *from_source = sd_event_source_unref(*from_source); *from = safe_close(*from); - } else if (errno != EAGAIN && errno != EINTR) { - log_error_errno(errno, "Failed to splice: %m"); - return -errno; - } + } else if (errno != EAGAIN && errno != EINTR) + return log_error_errno(errno, "Failed to splice: %m"); } if (*full > 0 && *to >= 0) { @@ -185,10 +179,8 @@ static int connection_shovel( } else if (z == 0 || errno == EPIPE || errno == ECONNRESET) { *to_source = sd_event_source_unref(*to_source); *to = safe_close(*to); - } else if (errno != EAGAIN && errno != EINTR) { - log_error_errno(errno, "Failed to splice: %m"); - return -errno; - } + } else if (errno != EAGAIN && errno != EINTR) + return log_error_errno(errno, "Failed to splice: %m"); } } while (shoveled); |