From 1ef0c1f15280a3ae366d43e2e4a86b5a1e1d454e Mon Sep 17 00:00:00 2001 From: N-R-K <79544946+N-R-K@users.noreply.github.com> Date: Thu, 17 Mar 2022 19:18:22 +0000 Subject: 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". --- main.c | 1 + 1 file changed, 1 insertion(+) 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); } } -- cgit v1.2.3