summaryrefslogtreecommitdiff
path: root/extlinux.asm
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-05-22 23:27:46 -0700
committerH. Peter Anvin <hpa@zytor.com>2007-05-22 23:27:46 -0700
commitb901a125510486e190dd841dfa616cafff0c9242 (patch)
treee0fe9893d5f3dc204b72509e70add30d414e2107 /extlinux.asm
parent1e7084a905560314d7a30b7826d77783f4d3740e (diff)
downloadsyslinux-3.50-pre15.tar.gz
Make it safe to call close_file on an already closed file.syslinux-3.50-pre15
The SYSLINUX internal API closes a file automatically upon reading to block EOF (not necessarily file EOF!) Thus, it's fairly likely we'll get SI == 0 (closed file) passed to close_file at some point or another. Just plain admit it, and make close_file accept SI == 0 by spec.
Diffstat (limited to 'extlinux.asm')
-rw-r--r--extlinux.asm4
1 files changed, 3 insertions, 1 deletions
diff --git a/extlinux.asm b/extlinux.asm
index 7d735073..a590a366 100644
--- a/extlinux.asm
+++ b/extlinux.asm
@@ -1039,8 +1039,10 @@ ThisInode resb EXT2_GOOD_OLD_INODE_SIZE ; The most recently opened inode
; Assumes CS == DS.
;
close_file:
+ and si,si
+ jz .closed
mov dword [si],0 ; First dword == file_left
- ret
+.closed: ret
;
; searchdir: