summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/fhandler.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2000-08-10 19:20:11 +0000
committerChristopher Faylor <me@cgf.cx>2000-08-10 19:20:11 +0000
commitb58f5598cbc77801bdbcc1de4d2fe0027fb68493 (patch)
tree3d0f06cfe2bc3f08f45b4980ae64c5ce1759f464 /winsup/cygwin/fhandler.cc
parent38a6bf987b2bb84d2c848a258cb3f93d102844bd (diff)
downloadcygnal-b58f5598cbc77801bdbcc1de4d2fe0027fb68493.tar.gz
cygnal-b58f5598cbc77801bdbcc1de4d2fe0027fb68493.tar.bz2
cygnal-b58f5598cbc77801bdbcc1de4d2fe0027fb68493.zip
* dir.cc (readdir): Ensure that errno is *only* set when we've run out of
filenames. * fhandler.cc (fhandler_disk_file::fstat): Use modern method for saving errno, making it effective for the whole function.
Diffstat (limited to 'winsup/cygwin/fhandler.cc')
-rw-r--r--winsup/cygwin/fhandler.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc
index 5e96c2518..46fb51e35 100644
--- a/winsup/cygwin/fhandler.cc
+++ b/winsup/cygwin/fhandler.cc
@@ -865,7 +865,7 @@ fhandler_disk_file::fstat (struct stat *buf)
{
int res = 0; // avoid a compiler warning
BY_HANDLE_FILE_INFORMATION local;
- int old_errno = get_errno ();
+ save_errno saved_errno;
memset (buf, 0, sizeof (*buf));
@@ -907,12 +907,10 @@ fhandler_disk_file::fstat (struct stat *buf)
if (!get_win32_name ())
{
- set_errno (ENOENT);
+ saved_errno.set (ENOENT);
return -1;
}
- set_errno (old_errno);
-
buf->st_atime = to_time_t (&local.ftLastAccessTime);
buf->st_mtime = to_time_t (&local.ftLastWriteTime);
buf->st_ctime = to_time_t (&local.ftCreationTime);