From 795ffc5e62e8ba383575dbcd9943a580d4bd3358 Mon Sep 17 00:00:00 2001 From: Jannis Hoffmann Date: Tue, 9 Jul 2024 15:50:21 +0200 Subject: formatting changes Manual format adjustments. Comment adjustments. Remove usage of the register keyword. --- src/socket_tcp.c | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) (limited to 'src/socket_tcp.c') diff --git a/src/socket_tcp.c b/src/socket_tcp.c index 70ada37..f350330 100644 --- a/src/socket_tcp.c +++ b/src/socket_tcp.c @@ -15,54 +15,51 @@ #endif /** - @file socket_tcp.c - @author djb, fefe, feh - @source ucspi-tcp6 - @brief setup TCP stream socket + @file socket_tcp.c + @author djb, fefe, feh + @source ucspi-tcp6 + @brief setup TCP stream socket */ int socket_tcp4(void) { - int s; - - s = socket(AF_INET, SOCK_STREAM, 0); - if (s != -1) + int s = socket(AF_INET, SOCK_STREAM, 0); + if (s != -1) { if (ndelay_on(s) == -1) { close(s); return -1; } + } return s; } int socket_tcp6(void) { - int s; - - s = socket(AF_INET6, SOCK_STREAM, 0); - if (s != -1) + int s = socket(AF_INET6, SOCK_STREAM, 0); + if (s != -1) { if (ndelay_on(s) == -1) { close(s); return -1; } + } return s; } int socket_tcp(void) { - int s; - - s = socket(AF_INET6, SOCK_STREAM, 0); + int s = socket(AF_INET6, SOCK_STREAM, 0); if (s == -1) if (errno == EINVAL || errno == EAFNOSUPPORT || errno == EPROTO || errno == EPROTONOSUPPORT) s = socket(AF_INET, SOCK_STREAM, 0); - if (s != -1) + if (s != -1) { if (ndelay_on(s) == -1) { close(s); return -1; } + } return s; } -- cgit v1.2.3