forked from Imagelibrary/rtems
2006-03-07 Till Strauman <strauman@slac.stanford.edu>
PR 830/filesystem * src/termios.c: termios ioctl(FIONREAD) reported wrong number of characters. So add chars in low-level/raw buffer to total count.
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
2006-03-07 Till Strauman <strauman@slac.stanford.edu>
|
||||
|
||||
PR 830/filesystem
|
||||
* src/termios.c: termios ioctl(FIONREAD) reported wrong number of
|
||||
characters. So add chars in low-level/raw buffer to total count.
|
||||
|
||||
2006-03-07 Till Strauman <strauman@slac.stanford.edu>
|
||||
|
||||
PR 886/filesystem
|
||||
|
||||
@@ -646,8 +646,13 @@ rtems_termios_ioctl (void *arg)
|
||||
break;
|
||||
#endif
|
||||
case FIONREAD:
|
||||
{
|
||||
int rawnc = tty->rawInBuf.Tail - tty->rawInBuf.Head;
|
||||
if ( rawnc < 0 )
|
||||
rawnc += tty->rawInBuf.Size;
|
||||
/* Half guess that this is the right operation */
|
||||
*(int *)args->buffer = tty->ccount - tty->cindex;
|
||||
*(int *)args->buffer = tty->ccount - tty->cindex + rawnc;
|
||||
}
|
||||
break;
|
||||
}
|
||||
rtems_semaphore_release (tty->osem);
|
||||
|
||||
Reference in New Issue
Block a user