* 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

@ -386,7 +386,7 @@ dtable::dup2 (int oldfd, int newfd)
SetResourceLock(LOCK_FD_LIST,WRITE_LOCK|READ_LOCK,"dup");
if ((size_t) newfd >= cygheap->fdtab.size || newfd < 0)
if (newfd < 0)
{
syscall_printf ("new fd out of bounds: %d", newfd);
set_errno (EBADF);