diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2011-05-05 13:05:04 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2011-05-05 13:05:04 +0400 |
commit | 392323df55fcf19800d8a5f4b943d63c092eedcc (patch) | |
tree | 5348faf7f2e047a8a1af89f4e2766c3a7a28047a /winsup/cygwin/fhandler.cc | |
parent | 03406c1ae6b029e1d8d5b3e8553adc9cd1e2ef6c (diff) |
* fhandler.cc (is_at_eof): Drop static storage class. Drop err
parameter since we don't change the Win32 error here anymore.
(fhandler_base::raw_read): Accommodate change to is_at_eof.
* fhandler_disk_file.cc (fhandler_disk_file::pread): In binary mode use
direct call to NtReadFile, rather than lseek/read.
(fhandler_disk_file::pwrite): In binary mode use direct call to
NtWriteFile, rather than lseek/write.
Diffstat (limited to 'winsup/cygwin/fhandler.cc')
-rw-r--r-- | winsup/cygwin/fhandler.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc index 858be1088..a4a256383 100644 --- a/winsup/cygwin/fhandler.cc +++ b/winsup/cygwin/fhandler.cc @@ -163,8 +163,8 @@ char *fhandler_base::get_proc_fd_name (char *buf) /* Detect if we are sitting at EOF for conditions where Windows returns an error but UNIX doesn't. */ -static int __stdcall -is_at_eof (HANDLE h, DWORD err) +int __stdcall +is_at_eof (HANDLE h) { IO_STATUS_BLOCK io; FILE_POSITION_INFORMATION fpi; @@ -176,7 +176,6 @@ is_at_eof (HANDLE h, DWORD err) FilePositionInformation)) && fsi.EndOfFile.QuadPart == fpi.CurrentByteOffset.QuadPart) return 1; - SetLastError (err); return 0; } @@ -237,7 +236,7 @@ retry: /* `bytes_read' is supposedly valid. */ break; case ERROR_NOACCESS: - if (is_at_eof (get_handle (), errcode)) + if (is_at_eof (get_handle ())) { bytes_read = 0; break; |