aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorN-R-K <79544946+N-R-K@users.noreply.github.com>2022-03-17 19:18:22 +0000
committerGitHub <noreply@github.com>2022-03-17 19:18:22 +0000
commit1ef0c1f15280a3ae366d43e2e4a86b5a1e1d454e (patch)
tree271e360472bf1da23378fc30d9f19eda040f464a
parent7f71ddf4fc73e84f376e91eba499223d523e4950 (diff)
fix: close the file descriptor in get_win_title() (#245)
this would eventually end up opening too many fds and erroring out with "too many open files".
-rw-r--r--main.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/main.c b/main.c
index d33d6ab..33f5cde 100644
--- a/main.c
+++ b/main.c
@@ -260,6 +260,7 @@ size_t get_win_title(unsigned char *buf, int len, bool init)
if (pfd.readfd >= 0) {
if ((n = read(pfd.readfd, buf, len-1)) > 0)
buf[n] = '\0';
+ close(pfd.readfd);
}
}