From dcc40f38fec766e8b6e969797e6947acfc640788 Mon Sep 17 00:00:00 2001 From: hidnplayr Date: Mon, 9 Jul 2012 10:06:17 +0000 Subject: [PATCH] Terminate sockets when process exits. git-svn-id: svn://kolibrios.org@2849 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/branches/net/kernel.asm | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/kernel/branches/net/kernel.asm b/kernel/branches/net/kernel.asm index c7e58278ee..adb243e634 100644 --- a/kernel/branches/net/kernel.asm +++ b/kernel/branches/net/kernel.asm @@ -66,6 +66,8 @@ ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +format binary as "mnt" + include 'macros.inc' include 'struct.inc' @@ -2034,15 +2036,22 @@ sysfn_terminate: ; 18.2 = TERMINATE push ecx cmp ecx, 2 jb noprocessterminate - mov edx, [TASK_COUNT] - cmp ecx, edx + + cmp ecx, [TASK_COUNT] ja noprocessterminate - mov eax, [TASK_COUNT] + shl ecx, 5 + mov eax, [TASK_COUNT] mov edx, [ecx+CURRENT_TASK+TASKDATA.pid] - add ecx, CURRENT_TASK+TASKDATA.state - cmp byte [ecx], 9 + + cmp byte [ecx+CURRENT_TASK+TASKDATA.state], 9 jz noprocessterminate +;-------------------------------------- +; terminate all network sockets it used + pusha + mov eax, edx + call SOCKET_process_end + popa ;-------------------------------------- cmp [_display.select_cursor], 0 je .restore_end