trace: show error message when fork fails in TraceScreen#2036
trace: show error message when fork fails in TraceScreen#2036dengzhongyuan365-dev wants to merge 2 commits into
Conversation
When TraceScreen_forkTracer() fails (e.g. out of memory, PID quota exceeded), the trace screen now displays the system error message instead of silently doing nothing. Fixes htop-dev#1991
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughChanges
Assessment against linked issues
Assessment against linked issues: Out-of-scope changes
Poem
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Save and restore errno in the TraceScreen_forkTracer error path so that close() calls in the cleanup do not clobber the original error value before it is read by TraceScreen_scan().
Summary
fork()fails, instead of silently doing nothingstrerror(errno)Changes
TraceScreen.cTraceScreen_scan()to display the system error when fork fails; register it in theInfoScreenClassstructAction.cif (ok)—InfoScreen_run()is always called so the TraceScreen appears even when fork failsTest Plan
son a process when fork is likely to fail (e.g. PID quota exceeded, or useulimit -uto restrict processes)Fixes #1991