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".
+1 −0
1 file changed
- M main.c +1 −0
| @@ -260,6 +260,7 @@ size_t get_win_title(unsigned char *buf, int len, bool init) | |||
| 260 | 260 | if (pfd.readfd >= 0) { | |
| 261 | 261 | if ((n = read(pfd.readfd, buf, len-1)) > 0) | |
| 262 | 262 | buf[n] = '\0'; | |
| 263 | + | close(pfd.readfd); | |
| 263 | 264 | } | |
| 264 | 265 | } | |
| 265 | 266 | ||