-
Notifications
You must be signed in to change notification settings - Fork 411
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Eliminate a misleading warning message about failing to kill a proc
This occurs when closing termshark after having used the stream reassembly or conversations function. The warning is printed because there is a race between the code that runs if the Golang context is cancelled to indicate the stream/conv processes should end early (e.g. user hits q while they are still running) and then has to kill the process just in case it's running still AND the deferred function that issues a waitpid(). The solution is to wait for both the process to complete AND for cancellation in the same select statement. If cancellation, then we haven't called waitpid() yet, so issue a kill (the pid won't be recycled for sure); if the process has completed/died, then cleanup and break the select loop.
- Loading branch information
Showing
3 changed files
with
88 additions
and
66 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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