fix minor fd leak regression in handlebin - geomyidae - A small C-based gopherd.
HTML git clone git://bitreich.org/geomyidae/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/geomyidae/
DIR Log
DIR Files
DIR Refs
DIR Tags
DIR README
DIR LICENSE
---
DIR commit e1ad0cf0b73a9ed594dfcb040044627b1e358e60
DIR parent 37420efd2d6430a88d60edd2c373689069b3c26e
HTML Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Wed, 7 Feb 2018 20:48:52 +0100
fix minor fd leak regression in handlebin
Signed-off-by: Christoph Lohmann <20h@r-36.net>
Diffstat:
M handlr.c | 1 +
M ind.c | 1 -
2 files changed, 1 insertion(+), 1 deletion(-)
---
DIR diff --git a/handlr.c b/handlr.c
@@ -116,6 +116,7 @@ handlebin(int sock, char *file, char *port, char *base, char *args,
if (fd >= 0) {
if (xsendfile(fd, sock) < 0)
perror("sendfile");
+ close(fd);
}
}
DIR diff --git a/ind.c b/ind.c
@@ -71,7 +71,6 @@ pendingbytes(int sock)
void
waitforpendingbytes(int sock)
{
-
while (pendingbytes(sock) > 0)
usleep(10);
}