Skip to content

fix: close directory handle in checkIfEmpty - #354

Merged
equationzhao merged 1 commit into
masterfrom
equationzhao/fix-checkifempty-fd-leak
Aug 13, 2026
Merged

fix: close directory handle in checkIfEmpty#354
equationzhao merged 1 commit into
masterfrom
equationzhao/fix-checkifempty-fd-leak

Conversation

@equationzhao

Copy link
Copy Markdown
Owner

Summary

  • Close the directory FD opened by checkIfEmpty after Readdirnames.
  • Treat any os.Open error as empty; Open does not return io.EOF.

Test plan

  • go test ./internal/content/ -run Test_checkIfEmpty
  • Manual: g --icon on a tree with many directories (no FD growth)

Made with Cursor

Avoid leaking FDs when probing empty dirs, and treat any Open error as empty instead of checking for io.EOF.

Co-authored-by: Cursor <cursoragent@cursor.com>
@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing

@cursor

cursor Bot commented Aug 12, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_bc1ce018-d0d6-40bf-ae22-3d6530ff6213)

@equationzhao
equationzhao merged commit fbc7581 into master Aug 13, 2026
12 of 13 checks passed
@equationzhao
equationzhao deleted the equationzhao/fix-checkifempty-fd-leak branch August 13, 2026 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant