Mail Archives: djgpp-workers/2003/03/07/13:33:38
Hello.
There's a bug in _write_fill_seek_gap that prevents the zero-fill
from working for files with file descriptors that bits 0-2 set.
The code is trying to avoid zero-fill for character devices,
where it's not applicable. But it does not check that the device info
has the character device bit set (_DEV_CDEV == 0x80).
Below is a patch that fixes this problem. OK to commit?
Bye, Rich =]
Index: src/libc/dos/io/_write.c
===================================================================
RCS file: /cvs/djgpp/djgpp/src/libc/dos/io/_write.c,v
retrieving revision 1.9
diff -p -c -3 -r1.9 _write.c
*** src/libc/dos/io/_write.c 29 Jan 2003 01:19:45 -0000 1.9
--- src/libc/dos/io/_write.c 7 Mar 2003 16:44:12 -0000
*************** _write_fill_seek_gap(int fd)
*** 57,63 ****
/* Quit when not working with a file. */
fd_info = _get_dev_info(fd);
! if (fd_info & (_DEV_STDIN | _DEV_STDOUT | _DEV_NUL))
{
/* Don't bother with handles that don't need the fix. */
__set_fd_flags(fd, FILE_DESC_DONT_FILL_EOF_GAP);
--- 57,63 ----
/* Quit when not working with a file. */
fd_info = _get_dev_info(fd);
! if (fd_info & _DEV_CDEV)
{
/* Don't bother with handles that don't need the fix. */
__set_fd_flags(fd, FILE_DESC_DONT_FILL_EOF_GAP);
- Raw text -