ftpd: Simplify console_fs_error logic
This commit is contained in:
@@ -337,6 +337,7 @@ align 4
|
|||||||
fs_err_table:
|
fs_err_table:
|
||||||
dd str_fs_error2 ; 2
|
dd str_fs_error2 ; 2
|
||||||
dd str_fs_error3 ; 3
|
dd str_fs_error3 ; 3
|
||||||
|
dd str_fs_error ; 4
|
||||||
dd str_fs_error5 ; 5
|
dd str_fs_error5 ; 5
|
||||||
dd str_fs_error6 ; 6
|
dd str_fs_error6 ; 6
|
||||||
dd str_fs_error7 ; 7
|
dd str_fs_error7 ; 7
|
||||||
@@ -347,23 +348,19 @@ fs_err_table:
|
|||||||
dd str_fs_error12 ; 12
|
dd str_fs_error12 ; 12
|
||||||
|
|
||||||
console_fs_error:
|
console_fs_error:
|
||||||
cmp eax, 2
|
mov edx, 4 ; Unknown filesystem error
|
||||||
jb .out_of_range
|
|
||||||
cmp eax, 12
|
|
||||||
ja .out_of_range
|
|
||||||
cmp eax, 4
|
|
||||||
ja .after4
|
|
||||||
sub eax, 2
|
|
||||||
jmp .index_ok
|
|
||||||
.after4:
|
|
||||||
sub eax, 3
|
|
||||||
.index_ok:
|
|
||||||
mov edx, [fs_err_table + eax*4]
|
|
||||||
invoke con_write_asciiz, edx
|
|
||||||
ret
|
|
||||||
|
|
||||||
.out_of_range:
|
cmp eax, 2
|
||||||
invoke con_write_asciiz, str_fs_error
|
jb .print_err
|
||||||
|
cmp eax, 12
|
||||||
|
ja .print_err
|
||||||
|
|
||||||
|
mov edx, eax
|
||||||
|
|
||||||
|
.print_err:
|
||||||
|
sub edx, 2
|
||||||
|
mov edx, [fs_err_table + edx*4]
|
||||||
|
invoke con_write_asciiz, edx
|
||||||
ret
|
ret
|
||||||
|
|
||||||
;------------------------------------------------
|
;------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user