Fixed sysfn 18.2

git-svn-id: svn://kolibrios.org@2867 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
hidnplayr 2012-07-13 14:02:54 +00:00
parent 96f1dd834c
commit 5a6b1713d2
2 changed files with 7 additions and 9 deletions

View File

@ -77,7 +77,7 @@ $Revision $
USE_COM_IRQ equ 1 ; make irq 3 and irq 4 available for PCI devices USE_COM_IRQ equ 1 ; make irq 3 and irq 4 available for PCI devices
; Enabling the next line will enable serial output console ; Enabling the next line will enable serial output console
;debug_com_base equ 0x3f8 ; 0x3f8 is com1, 0x2f8 is com2, 0x3e8 is com3, 0x2e8 is com4, no irq's are used debug_com_base equ 0x2f8 ; 0x3f8 is com1, 0x2f8 is com2, 0x3e8 is com3, 0x2e8 is com4, no irq's are used
include "proc32.inc" include "proc32.inc"
include "kglobals.inc" include "kglobals.inc"
@ -2044,12 +2044,12 @@ sysfn_terminate: ; 18.2 = TERMINATE
mov eax, [TASK_COUNT] mov eax, [TASK_COUNT]
mov edx, [ecx+CURRENT_TASK+TASKDATA.pid] mov edx, [ecx+CURRENT_TASK+TASKDATA.pid]
cmp byte [ecx+CURRENT_TASK+TASKDATA.state], 9 add ecx, CURRENT_TASK+TASKDATA.state
cmp byte [ecx], 9
jz noprocessterminate jz noprocessterminate
;-------------------------------------- ;--------------------------------------
; terminate all network sockets it used ; terminate all network sockets it used
pusha pusha
mov eax, edx
call SOCKET_process_end call SOCKET_process_end
popa popa
;-------------------------------------- ;--------------------------------------

View File

@ -1711,29 +1711,28 @@ SOCKET_check_owner:
; This function will check if the process had any open sockets ; This function will check if the process had any open sockets
; And update them accordingly ; And update them accordingly
; ;
; IN: eax = pid ; IN: edx = pid
; OUT: / ; OUT: /
; ;
;------------------------------------------------------ ;------------------------------------------------------
align 4 align 4
SOCKET_process_end: SOCKET_process_end:
DEBUGF 1,"SOCKET_process_end: %x\n", eax DEBUGF 1,"SOCKET_process_end: %x\n", edx
push ebx push ebx
mov ebx, net_sockets mov ebx, net_sockets
.next_socket: .next_socket:
mov ebx, [ebx + SOCKET.NextPtr] mov ebx, [ebx + SOCKET.NextPtr]
.test_socket: .test_socket:
test ebx, ebx test ebx, ebx
jz .done jz .done
cmp [ebx + SOCKET.PID], eax cmp [ebx + SOCKET.PID], edx
jne .next_socket jne .next_socket
DEBUGF 1,"closing socket %x", eax, ebx DEBUGF 1,"closing socket %x", edx, ebx
mov [ebx + SOCKET.PID], 0 mov [ebx + SOCKET.PID], 0
@ -1748,7 +1747,6 @@ SOCKET_process_end:
jmp .test_socket jmp .test_socket
.tcp: .tcp:
push [ebx + SOCKET.NextPtr] push [ebx + SOCKET.NextPtr]
mov eax, ebx mov eax, ebx
call TCP_close call TCP_close