diff options
author | Christopher Faylor <me@cgf.cx> | 2001-10-16 07:31:50 +0400 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2001-10-16 07:31:50 +0400 |
commit | 0f4db8cbe03453c0715aff20b074816d455847b4 (patch) | |
tree | f25bad6474738ae7b1eb8f60b4b7497c66e5855c /winsup/cygwin/fcntl.cc | |
parent | df63bd490a526af2d68f391f703abe8b54a502db (diff) |
* 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.
Diffstat (limited to 'winsup/cygwin/fcntl.cc')
-rw-r--r-- | winsup/cygwin/fcntl.cc | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/winsup/cygwin/fcntl.cc b/winsup/cygwin/fcntl.cc index 17889ac98..95b622c04 100644 --- a/winsup/cygwin/fcntl.cc +++ b/winsup/cygwin/fcntl.cc @@ -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: |