diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2006-03-07 22:22:46 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2006-03-07 22:22:46 +0000 |
commit | ca6df52f0bf910bf8dd464f10416c41f2129f7e2 (patch) | |
tree | f53b80c2376a46e9a5eaca1448ea542128067b1d /cpukit | |
parent | 2006-03-07 Steven Johnson <sjohnson@sakuraindustries.com> (diff) | |
download | rtems-ca6df52f0bf910bf8dd464f10416c41f2129f7e2.tar.bz2 |
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.
Diffstat (limited to 'cpukit')
-rw-r--r-- | cpukit/libcsupport/ChangeLog | 6 | ||||
-rw-r--r-- | cpukit/libcsupport/src/termios.c | 7 |
2 files changed, 12 insertions, 1 deletions
diff --git a/cpukit/libcsupport/ChangeLog b/cpukit/libcsupport/ChangeLog index 92bd4689f7..bce4d03274 100644 --- a/cpukit/libcsupport/ChangeLog +++ b/cpukit/libcsupport/ChangeLog @@ -1,5 +1,11 @@ 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 * src/libio.c: fcntl(fd,F_GETFL) fails to set O_NONBLOCK if the descriptor is in non-blocking mode. diff --git a/cpukit/libcsupport/src/termios.c b/cpukit/libcsupport/src/termios.c index a6040e24b8..58d6ccc666 100644 --- a/cpukit/libcsupport/src/termios.c +++ b/cpukit/libcsupport/src/termios.c @@ -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); |