From 44a1ab4165ee96f779c46f41c071217207731ee1 Mon Sep 17 00:00:00 2001 From: cgf Date: Fri, 31 May 2002 00:15:21 +0000 Subject: [PATCH] * fhandler_disk_file.cc (fhandler_disk_file::fstat): Always call fstat_by_name if fd is not opened to allow fstat_by_name to properly set errno. * fhandler.cc (binmode): Default to binmode when mode is not known. --- winsup/cygwin/ChangeLog | 10 ++++++++++ winsup/cygwin/fhandler.cc | 2 +- winsup/cygwin/fhandler_disk_file.cc | 6 +++--- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index f525be6c13..f3ccf013eb 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +2002-05-30 Christopher Faylor + + * fhandler_disk_file.cc (fhandler_disk_file::fstat): Always call + fstat_by_name if fd is not opened to allow fstat_by_name to properly + set errno. + 2002-05-30 Corinna Vinschen * autoload.cc: Replace autoload statments for ZwXXX by NtXXX. @@ -19,6 +25,10 @@ 2002-05-29 Christopher Faylor + * fhandler.cc (binmode): Default to binmode when mode is not known. + +2002-05-29 Christopher Faylor + * include/sys/cygwin.h (EXTERNAL_PINFO_VERSION): Reinstate. * external.cc (fillout_pinfo): Use it. diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc index e9af8b4f63..756a74804e 100644 --- a/winsup/cygwin/fhandler.cc +++ b/winsup/cygwin/fhandler.cc @@ -434,7 +434,7 @@ fhandler_base::open (path_conv *pc, int flags, mode_t mode) else if (fmode & O_TEXT) bin = O_TEXT; else if (get_device () == FH_DISK) - bin = get_w_binary () || get_r_binary (); + bin = get_w_binary () || get_r_binary () || O_BINARY; else bin = (binmode == O_BINARY) || get_w_binary () || get_r_binary (); diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc index c4474f184a..5c266ee0ba 100644 --- a/winsup/cygwin/fhandler_disk_file.cc +++ b/winsup/cygwin/fhandler_disk_file.cc @@ -166,13 +166,13 @@ fhandler_disk_file::fstat (struct __stat64 *buf, path_conv *pc) } } - if (oret) + if (!oret) + res = fstat_by_name (buf, pc); + else { res = fstat_by_handle (buf, pc); close (); } - else if (pc->exists ()) - res = fstat_by_name (buf, pc); return res; } -- 2.11.0