Krolyxon
Commit 1ef0c1f

Branches

Refs →

nsxiv1ef0c1f

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".
Author
N-R-K
Date
2022-03-17 19:18 +0000
Committer
GitHub · 2022-03-17 19:18 +0000
Parent
7f71ddf
Commit
1ef0c1f15280a3ae366d43e2e4a86b5a1e1d454e

+1 −0

1 file changed

  1. M main.c +1 −0
M main.c View
@@ -260,6 +260,7 @@ size_t get_win_title(unsigned char *buf, int len, bool init)
260260 if (pfd.readfd >= 0) {
261261 if ((n = read(pfd.readfd, buf, len-1)) > 0)
262262 buf[n] = '\0';
263+ close(pfd.readfd);
263264 }
264265 }
265266