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".
This commit is contained in:
parent
7f71ddf4fc
commit
1ef0c1f152
1 changed files with 1 additions and 0 deletions
1
main.c
1
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue