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.
This commit is contained in:
Simon Ser 2021-10-23 14:30:28 +00:00 committed by Kenny Levinsen
parent 88db55f606
commit cb7a94378b

View file

@ -123,8 +123,8 @@ static int set_nonblock(int fd) {
int server_add_client(struct server *server, int fd) { int server_add_client(struct server *server, int fd) {
if (set_nonblock(fd) != 0) { if (set_nonblock(fd) != 0) {
close(fd);
log_errorf("Could not prepare new client socket: %s", strerror(errno)); log_errorf("Could not prepare new client socket: %s", strerror(errno));
close(fd);
return -1; return -1;
} }