summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/fhandler.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2006-08-10 14:15:00 +0000
committerChristopher Faylor <me@cgf.cx>2006-08-10 14:15:00 +0000
commit44d67b9b31f86fc7dd359a097fa413eee85b6b35 (patch)
tree3b504d4212b8fc0f9facc5a15f6e309da0af43e6 /winsup/cygwin/fhandler.cc
parent887e02e47804ec4dd84cf71501e0b49b4f2ddc2c (diff)
downloadcygnal-44d67b9b31f86fc7dd359a097fa413eee85b6b35.tar.gz
cygnal-44d67b9b31f86fc7dd359a097fa413eee85b6b35.tar.bz2
cygnal-44d67b9b31f86fc7dd359a097fa413eee85b6b35.zip
* winsup.h: Turn on DEBUGGING by default for now.
Diffstat (limited to 'winsup/cygwin/fhandler.cc')
-rw-r--r--winsup/cygwin/fhandler.cc18
1 files changed, 2 insertions, 16 deletions
diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc
index 00e987587..ae5edcb62 100644
--- a/winsup/cygwin/fhandler.cc
+++ b/winsup/cygwin/fhandler.cc
@@ -31,6 +31,7 @@ details. */
#include <winioctl.h>
#include <ntdef.h>
#include "ntdll.h"
+#include "mmap_helper.h"
static NO_COPY const int CHUNK_SIZE = 1024; /* Used for crlf conversions */
@@ -223,10 +224,8 @@ fhandler_base::raw_read (void *ptr, size_t& ulen)
HANDLE h = NULL; /* grumble */
int prio = 0; /* ditto */
- int try_noreserve = 1;
DWORD len = ulen;
-retry:
ulen = (size_t) -1;
if (read_state)
{
@@ -235,7 +234,7 @@ retry:
SetThreadPriority (h, THREAD_PRIORITY_TIME_CRITICAL);
signal_read_state (1);
}
- BOOL res = ReadFile (get_handle (), ptr, len, (DWORD *) &ulen, 0);
+ BOOL res = mmReadFile (get_handle (), ptr, len, (DWORD *) &ulen, 0);
if (read_state)
{
signal_read_state (1);
@@ -261,19 +260,6 @@ retry:
bytes_read = 0;
break;
}
- if (try_noreserve)
- {
- try_noreserve = 0;
- switch (mmap_is_attached_or_noreserve (ptr, len))
- {
- case MMAP_NORESERVE_COMMITED:
- goto retry;
- case MMAP_RAISE_SIGBUS:
- raise(SIGBUS);
- case MMAP_NONE:
- break;
- }
- }
/*FALLTHRU*/
case ERROR_INVALID_FUNCTION:
case ERROR_INVALID_PARAMETER: