* 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:
		| @@ -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); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user