Skip to content

w: don't fail when tty device is missing - #719

Open
Franklin-Qi wants to merge 1 commit into
uutils:mainfrom
Franklin-Qi:fix-bug#718-not-fail-when-tty-device-is-missing
Open

w: don't fail when tty device is missing#719
Franklin-Qi wants to merge 1 commit into
uutils:mainfrom
Franklin-Qi:fix-bug#718-not-fail-when-tty-device-is-missing

Conversation

@Franklin-Qi

Copy link
Copy Markdown
Contributor
  • Treat missing or unreadable /dev/<tty> as zero idle time instead of exiting with an error
  • Add unit test for missing tty handling

Closes: #718

- Treat missing or unreadable `/dev/<tty>` as zero idle time instead of exiting with an error
- Add unit test for missing tty handling
Closes: uutils#718
@sylvestre

Copy link
Copy Markdown
Contributor

can we also get a test in https://github.com/uutils/procps/blob/main/tests/by-util/test_w.rs ? thanks

@codecov

codecovBot commented Jun 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 19.18%. Comparing base (9f4a1ea) to head (012b57f).
⚠️ Report is 60 commits behind head on main.

Files with missing linesPatch %Lines
src/uu/w/src/w.rs0.00%10 Missing ⚠️
Additional details and impacted files
@@ Coverage Diff @@## main #719 +/- ##
==========================================
- Coverage 19.19% 19.18% -0.01% 
==========================================
Files 68 68 Lines 10158 10162 +4 Branches 546 549 +3 ==========================================
Hits 1950 1950 - Misses 8208 8212 +4 
FlagCoverage Δ
macos_latest6.74% <ø> (ø)
ubuntu_latest19.54% <0.00%> (-0.01%)⬇️
windows_latest0.02% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Franklin-Qi

Copy link
Copy Markdown
ContributorAuthor

can we also get a test in https://github.com/uutils/procps/blob/main/tests/by-util/test_w.rs ? thanks

@sylvestre Thank you for the review; I will add test cases.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

w: exits with error when utmp session references a missing tty device

2 participants

@Franklin-Qi@sylvestre