Skip to content
This repository was archived by the owner on Nov 22, 2023. It is now read-only.

Commit 22209b7

Browse files
committed
(fflush) Have some sensible logic for calling fsync
1 parent 9742d9c commit 22209b7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

libsrc/stdio/fflush.c

+5-3
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,20 @@ ELSE
2727
push bc
2828
ENDIF
2929
IF !__CPU_INTEL__ && !__CPU_GBZ80__ && !_CPU_GBZ80__
30-
ld e,(hl)
30+
ld e,(hl) ;fd
3131
inc hl
3232
ld d,(hl)
3333
inc hl
3434
ld a,(hl)
3535
and _IOUSE|_IOSYSTEM|_IOWRITE
3636
cp _IOUSE|_IOWRITE
37-
ld a,(hl)
38-
jr check_extra
37+
jr nz,check_extra
38+
push de ;fd
3939
call fsync
40+
pop bc ;dump param
4041
ret
4142
check_extra:
43+
ld a,(hl)
4244
and _IOUSE|_IOEXTRA
4345
cp _IOUSE|_IOEXTRA
4446
jr nz,fflush_error ;not used

0 commit comments

Comments
 (0)