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:
parent
88db55f606
commit
cb7a94378b
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue