tools/qvm-run: translate negative return codes (signals) to positive exit codes#457
tools/qvm-run: translate negative return codes (signals) to positive exit codes#457EliasDevv wants to merge 1 commit into
Conversation
|
I'm aware the commits are not GPG-signed yet. I'm setting up commit signing and will force-push signed commits shortly. |
|
Please change the title of the commit message. "Translating return code" is what had to be done to accomplish the proposed goal. What this commit is about is exiting with the appropriate code. |
| ) | ||
| retcode = max(retcode, proc.wait()) | ||
| retcode = max(retcode, this_retcode) | ||
| except KeyboardInterrupt: |
There was a problem hiding this comment.
For Ctrl-c, the except section applies, and here similar conversion is needed.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #457 +/- ##
==========================================
+ Coverage 76.35% 76.36% +0.01%
==========================================
Files 53 53
Lines 9388 9401 +13
==========================================
+ Hits 7168 7179 +11
- Misses 2220 2222 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@EliasDevv are you still working on this? |
When qvm-run is interrupted via SIGINT (ctrl-c), subprocess.wait()
returns a negative value (-signal). This translates negative return
codes to positive exit codes using abs(retcode) + 128, consistent
with shell signal handling conventions.
Fixes QubesOS/qubes-issues#10468