aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/net.c
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2022-08-26 07:15:03 +0200
committerEgor Tensin <Egor.Tensin@gmail.com>2022-08-26 07:15:45 +0200
commit93b8646855353ab3adfe5fea8ccb5b0842ad8a0d (patch)
treec87ac95cd819f654d60e360f84a5559faa7de9fe /src/net.c
parentfix macros (diff)
downloadcimple-93b8646855353ab3adfe5fea8ccb5b0842ad8a0d.tar.gz
cimple-93b8646855353ab3adfe5fea8ccb5b0842ad8a0d.zip
add check_errno macro
Diffstat (limited to '')
-rw-r--r--src/net.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/net.c b/src/net.c
index ceffba0..4ff7a4a 100644
--- a/src/net.c
+++ b/src/net.c
@@ -49,7 +49,7 @@ int net_bind(const char *port)
break;
close_socket:
- close(socket_fd);
+ check_errno(close(socket_fd), "close");
}
freeaddrinfo(result);
@@ -68,7 +68,7 @@ int net_bind(const char *port)
return socket_fd;
fail:
- close(socket_fd);
+ check_errno(close(socket_fd), "close");
return ret;
}
@@ -117,7 +117,7 @@ int net_connect(const char *host, const char *port)
break;
close_socket:
- close(socket_fd);
+ check_errno(close(socket_fd), "close");
}
freeaddrinfo(result);