Browse files

small cleanup

  • Loading branch information...
1 parent 1eb3a9b commit 472b66eb214e52fab3225827144070b7650724c3 Eugene Ma committed Sep 16, 2011
Showing with 8 additions and 3 deletions.
  1. +8 −3 asmscan.asm
View
11 asmscan.asm
@@ -1078,25 +1078,30 @@ cleanup_sockets:
; that can exist in a fdset.
mov eax, 1023
lea ecx, [masterfds + masterfdslen]
+
; Find dword containing highest numbered file descriptor
find_highest_loop:
cmp [ecx], dword 0
jnz cleanup_sockets_loop
sub eax, 32
sub ecx, 4
jmp find_highest_loop
+
; Loop through remaining bits in fdset
cleanup_sockets_loop:
; Clear bit to zero and store original bit in CF
btr [masterfds], eax
; If bit was set, close the mapped socket
jc close_socket
+
; Otherwise go to next socket
jmp free_next_socket
+
close_socket:
- push eax
- call sys_close
- pop eax
+ push eax
+ call sys_close
+ pop eax
+
; Keep looking for sockets to free until counter is negative
free_next_socket:
dec eax

0 comments on commit 472b66e

Please sign in to comment.