* cygerrno.h (set_errno): Define more informative version of this function for
debugging. (__set_errno): Declare when DEBUGGING. * cygheap.h (cygheap_fdget::cygheap_fdget): Add a flag to control when errno is set. * debug.cc (__set_errno): New function. * fcntl.cc (_fcntl): Fix so that correct fd is used for second argument to dup2. * syscalls.cc (_cygwin_istext_for_stdio): Don't set errno here when using cygheap_fdget.
This commit is contained in:
@@ -41,13 +41,7 @@ _fcntl (int fd, int cmd,...)
|
||||
if (cmd != F_DUPFD)
|
||||
res = cfd->fcntl(cmd, arg);
|
||||
else
|
||||
{
|
||||
cygheap_fdnew newfd;
|
||||
if (newfd >= 0)
|
||||
res = dup2 (fd, newfd);
|
||||
else
|
||||
res = -1;
|
||||
}
|
||||
res = dup2 (fd, cygheap_fdnew (((int) arg) - 1));
|
||||
va_end (args);
|
||||
|
||||
done:
|
||||
|
Reference in New Issue
Block a user