8000 Close pipe after lsof by Jesin · Pull Request #917 · hishamhm/htop · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Close pipe after lsof - #917

Open
Jesin wants to merge 1 commit into
hishamhm:masterfrom
Jesin:fix
Open

Jesin wants to merge 1 commit into
hishamhm:masterfrom
Jesin:fix

Conversation

@Jesin
@Jesin Jesin commented Jun 23, 2019
Copy link
Copy Markdown
Contributor

When htop runs lsof, it leaves the read end of the pipe open. You can see this by selecting the htop process itself, pressing l, and then pressing F5/Refresh repeatedly. Every time it refreshes, there's 1 more pipe fd in the table until RLIMIT_NOFILE is reached. This commit fixes that.

@Jesin
Jesin commented Nov 23, 2019
Copy link
Copy Markdown
Contributor Author

Note that this commit also fixes a memory leak, since fdopen and fclose internally use malloc and free respectively (at least on some implementations).

aswild pushed a commit to aswild/htop that referenced this pull request Apr 9, 2020
@natoscott
Copy link
Copy Markdown
Collaborator

Merged here: htop-dev/htop@74d5476

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0