Merged
Conversation
voctory
reviewed
Dec 6, 2025
Comment on lines
+66
to
+75
| fn do_kill(&mut self) -> IoResult<()> { | ||
| let proc = self.proc.lock().unwrap().try_clone().unwrap(); | ||
| let res = unsafe { TerminateProcess(proc.as_raw_handle() as _, 1) }; | ||
| let err = IoError::last_os_error(); | ||
| if res != 0 { | ||
| Err(err) | ||
| } else { | ||
| Ok(()) | ||
| } | ||
| } |
Contributor
There was a problem hiding this comment.
Likely out-of-scope, but TerminateProcess’s return code seems backwards?
It should return nonzero on success, but as it stands, the branch returns Err when res != 0 and Ok(()) when res == 0. So do_kill() reports an error when the process is terminated and a success when the termination fails
Collaborator
Author
There was a problem hiding this comment.
Good, catch! I'll keep the code as is for now to minimize changes but will keep this in mind.
Comment on lines
+96
to
+104
| fn kill(&mut self) -> IoResult<()> { | ||
| let res = unsafe { TerminateProcess(self.proc.as_raw_handle() as _, 1) }; | ||
| let err = IoError::last_os_error(); | ||
| if res != 0 { | ||
| Err(err) | ||
| } else { | ||
| Ok(()) | ||
| } | ||
| } |
jif-oai
approved these changes
Dec 9, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The repo we were depending on is very large and we need very small part of it.