aboutsummaryrefslogtreecommitdiff
path: root/seatd/server.c
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2021-10-23 14:30:28 +0000
committerKenny Levinsen <kl@kl.wtf>2021-10-24 00:52:08 +0200
commitcb7a94378b96b9c7e0da8ea8e3a2e756b4976d35 (patch)
treea3321ba784cd6f85378bdaafd11ece0b185a3ab8 /seatd/server.c
parent88db55f6068c1c01d85b61aa6adff0a6b2a8dce8 (diff)
seatd: avoid overwriting errno in set_nonblock error handling
If close fails, it'll mess up errno, and log_errorf will print a non-sensical value.
Diffstat (limited to 'seatd/server.c')
-rw-r--r--seatd/server.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/seatd/server.c b/seatd/server.c
index 0a08f50..8e59c5d 100644
--- a/seatd/server.c
+++ b/seatd/server.c
@@ -123,8 +123,8 @@ static int set_nonblock(int fd) {
int server_add_client(struct server *server, int fd) {
if (set_nonblock(fd) != 0) {
- close(fd);
log_errorf("Could not prepare new client socket: %s", strerror(errno));
+ close(fd);
return -1;
}