Skip to content

Commit

Permalink
updated kill procedure
Browse files Browse the repository at this point in the history
  • Loading branch information
Freaxed committed Dec 17, 2024
1 parent f8c7240 commit 760db24
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/helpers/mterm/MTerm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,16 +182,17 @@ void
MTerm::Kill()
{
syslog(LOG_INFO|LOG_PID|LOG_CONS|LOG_USER, "S) Genio: MTerm::Kill called (fExecProcessID %d fReadTask %p fFd %d)", fExecProcessID, fReadTask, fFd);
if(fExecProcessID > -1) {
kill_thread(fExecProcessID);
fExecProcessID = -1;
}

if (fReadTask) {
fReadTask->Stop();
fReadTask = nullptr;
}
if (fFd > -1) {
if (fFd >= 0) {
close(fFd);
kill(-fExecProcessID, SIGHUP);
fExecProcessID = -1;
int status;
wait(&status);
fFd = -1;
}
syslog(LOG_INFO|LOG_PID|LOG_CONS|LOG_USER, "E) Genio: MTerm::Kill called (fExecProcessID %d fReadTask %p fFd %d)", fExecProcessID, fReadTask, fFd);
Expand Down

0 comments on commit 760db24

Please sign in to comment.