From f60a028a4e8633245592370264665ba203a56193 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 19 Mar 2019 15:39:34 +0100 Subject: tree-wide: use ERRNO_IS_DISCONNECT() at more places --- src/socket-proxy/socket-proxyd.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/socket-proxy') diff --git a/src/socket-proxy/socket-proxyd.c b/src/socket-proxy/socket-proxyd.c index bac5c164d4..fc7e4958be 100644 --- a/src/socket-proxy/socket-proxyd.c +++ b/src/socket-proxy/socket-proxyd.c @@ -16,6 +16,7 @@ #include "sd-resolve.h" #include "alloc-util.h" +#include "errno-util.h" #include "fd-util.h" #include "log.h" #include "main-func.h" @@ -29,8 +30,8 @@ #include "util.h" #define BUFFER_SIZE (256 * 1024) -static unsigned arg_connections_max = 256; +static unsigned arg_connections_max = 256; static const char *arg_remote_host = NULL; typedef struct Context { @@ -141,7 +142,7 @@ static int connection_shovel( if (z > 0) { *full += z; shoveled = true; - } else if (z == 0 || IN_SET(errno, EPIPE, ECONNRESET)) { + } else if (z == 0 || ERRNO_IS_DISCONNECT(errno)) { *from_source = sd_event_source_unref(*from_source); *from = safe_close(*from); } else if (!IN_SET(errno, EAGAIN, EINTR)) @@ -153,7 +154,7 @@ static int connection_shovel( if (z > 0) { *full -= z; shoveled = true; - } else if (z == 0 || IN_SET(errno, EPIPE, ECONNRESET)) { + } else if (z == 0 || ERRNO_IS_DISCONNECT(errno)) { *to_source = sd_event_source_unref(*to_source); *to = safe_close(*to); } else if (!IN_SET(errno, EAGAIN, EINTR)) -- cgit v1.2.1