* dtable.cc (dtable::dup2): Allow extension of fd table by dup2.

* syscalls.cc: Minor code cleanup.
(fpathconf): Check for bad fd before doing anything else.
* termios.cc (tcsetattr): Don't convert to new termios if bad fd.
(tcgetattr): Minor debugging tweak.
This commit is contained in:
Christopher Faylor
2001-08-23 02:27:01 +00:00
parent cb19ccf4b5
commit ecaff08ccd
4 changed files with 28 additions and 24 deletions

View File

@ -143,13 +143,14 @@ tcsetattr (int fd, int a, const struct termios *t)
{
int res = -1;
t = __tonew_termios (t);
if (cygheap->fdtab.not_open (fd))
{
set_errno (EBADF);
goto out;
}
t = __tonew_termios (t);
fhandler_base *fh;
fh = cygheap->fdtab[fd];
@ -187,7 +188,7 @@ tcgetattr (int fd, struct termios *in_t)
}
if (res)
termios_printf ("%d = tcgetattr (%d, %x)", res, fd, in_t);
termios_printf ("%d = tcgetattr (%d, %p)", res, fd, in_t);
else
termios_printf ("iflag %x, oflag %x, cflag %x, lflag %x, VMIN %d, VTIME %d",
t->c_iflag, t->c_oflag, t->c_cflag, t->c_lflag, t->c_cc[VMIN],