Kill child process and close pty on exit

- Adds kill() method to LibuvUtils.
- Adds close() method to Pipe.
This commit is contained in:
Leroy Hopson 2021-07-22 12:17:23 +07:00
parent 55b0a0577d
commit c81da3820b
No known key found for this signature in database
GPG key ID: D2747312A6DB51AA
10 changed files with 53 additions and 9 deletions

View file

@ -212,8 +212,11 @@ func destroy() -> void:
# Kill the pty.
# sigint: The signal to send. By default this is SIGHUP.
# This is not supported on Windows.
func kill(sigint: int = Signal.SIGHUP) -> void:
pass
func kill(signum: int = Signal.SIGHUP) -> void:
if _pipe:
_pipe.close()
if pid > 0:
LibuvUtils.kill(pid, signum)
func fork(