liminix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 9e5f2d663d9acb4c30e714a062efa4e917c1a970
parent 21eeb1671e56271e96a38d997dd72339fd14e566
Author: Daniel Barlow <dan@telent.net>
Date:   Sun, 15 Sep 2024 22:09:31 +0100

close socket fd if we can't connect it

Diffstat:
Mpkgs/logshipper/logtee.c | 1+
1 file changed, 1 insertion(+), 0 deletions(-)

diff --git a/pkgs/logshipper/logtee.c b/pkgs/logshipper/logtee.c @@ -24,6 +24,7 @@ int open_shipper_socket(char *pathname) { if(fd >= 0) { if(connect(fd, (struct sockaddr *) &sa, sizeof sa)) { error(0, errno, "connect socket \"%s\"", pathname); + close(fd); return -1; } int flags = fcntl(fd, F_GETFL);