~kennylevinsen/seatd-devel

seatd: avoid overwriting errno in set_nonblock error handling v1 APPLIED

Simon Ser: 1
 seatd: avoid overwriting errno in set_nonblock error handling

 1 files changed, 1 insertions(+), 1 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~kennylevinsen/seatd-devel/patches/25898/mbox | git am -3
Learn more about email & git

[PATCH] seatd: avoid overwriting errno in set_nonblock error handling Export this patch

If close fails, it'll mess up errno, and log_errorf will print a
non-sensical value.
---
 seatd/server.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/seatd/server.c b/seatd/server.c
index 73e6a2bc2463..03840fdd1343 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;
	}

-- 
2.33.1
Applied, thanks!