--- ansh/src/utils.c 2011/10/14 12:03:10 1.1.1.1.2.11 +++ ansh/src/utils.c 2011/10/14 12:45:09 1.1.1.1.2.12 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ - * $Id: utils.c,v 1.1.1.1.2.11 2011/10/14 12:03:10 misho Exp $ + * $Id: utils.c,v 1.1.1.1.2.12 2011/10/14 12:45:09 misho Exp $ * ************************************************************************* The ELWIX and AITNET software is distributed under the following @@ -524,12 +524,15 @@ stopProcess(sched_root_task_t * __restrict root, proc_ if (p->proc_pid == pid) { break; } + VERB(3) LOG("pid=%d found=%p\n", pid, p); if (!p) return 1; ioFreePTY(p->proc_pty, p->proc_ttyname); - schedCancelby(root, NULL, CRITERIA_FD, (void*) ((intptr_t) p->proc_pty), NULL); + if (p->proc_pty) + schedCancelby(root, NULL, CRITERIA_FD, (void*) ((intptr_t) p->proc_pty), NULL); + p->proc_pty = 0; p->proc_pid = 0; p->proc_seq = 0; p->proc_flg = ANSH_FLG_EOF;