aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/tcp_server.c
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2023-06-08 23:57:49 +0200
committerEgor Tensin <Egor.Tensin@gmail.com>2023-06-09 00:01:11 +0200
commitfb80276084a9adc0014b1008f8bf8253f126293b (patch)
tree2951be23576c32ddcda656c04c98539591981622 /src/tcp_server.c
parentdocker: bump base image (diff)
downloadcimple-fb80276084a9adc0014b1008f8bf8253f126293b.tar.gz
cimple-fb80276084a9adc0014b1008f8bf8253f126293b.zip
add {file,net}_close as a wrapper to close(2)
Diffstat (limited to 'src/tcp_server.c')
-rw-r--r--src/tcp_server.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/tcp_server.c b/src/tcp_server.c
index 277f81e..2e65bc5 100644
--- a/src/tcp_server.c
+++ b/src/tcp_server.c
@@ -13,7 +13,6 @@
#include <pthread.h>
#include <signal.h>
#include <stdlib.h>
-#include <unistd.h>
struct tcp_server {
int fd;
@@ -45,7 +44,7 @@ free:
void tcp_server_destroy(struct tcp_server *server)
{
- log_errno_if(close(server->fd), "close");
+ net_close(server->fd);
free(server);
}
@@ -116,7 +115,7 @@ restore_mask:
signal_restore(&old_mask);
close_conn:
- log_errno_if(close(ctx->fd), "close");
+ net_close(ctx->fd);
free_ctx:
free(ctx);