mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-18 12:29:32 +08:00
revert erroneous checkin
This commit is contained in:
parent
44d67b9b31
commit
2f98d8bdc7
@ -31,7 +31,6 @@ details. */
|
|||||||
#include <winioctl.h>
|
#include <winioctl.h>
|
||||||
#include <ntdef.h>
|
#include <ntdef.h>
|
||||||
#include "ntdll.h"
|
#include "ntdll.h"
|
||||||
#include "mmap_helper.h"
|
|
||||||
|
|
||||||
static NO_COPY const int CHUNK_SIZE = 1024; /* Used for crlf conversions */
|
static NO_COPY const int CHUNK_SIZE = 1024; /* Used for crlf conversions */
|
||||||
|
|
||||||
@ -224,8 +223,10 @@ fhandler_base::raw_read (void *ptr, size_t& ulen)
|
|||||||
|
|
||||||
HANDLE h = NULL; /* grumble */
|
HANDLE h = NULL; /* grumble */
|
||||||
int prio = 0; /* ditto */
|
int prio = 0; /* ditto */
|
||||||
|
int try_noreserve = 1;
|
||||||
DWORD len = ulen;
|
DWORD len = ulen;
|
||||||
|
|
||||||
|
retry:
|
||||||
ulen = (size_t) -1;
|
ulen = (size_t) -1;
|
||||||
if (read_state)
|
if (read_state)
|
||||||
{
|
{
|
||||||
@ -234,7 +235,7 @@ fhandler_base::raw_read (void *ptr, size_t& ulen)
|
|||||||
SetThreadPriority (h, THREAD_PRIORITY_TIME_CRITICAL);
|
SetThreadPriority (h, THREAD_PRIORITY_TIME_CRITICAL);
|
||||||
signal_read_state (1);
|
signal_read_state (1);
|
||||||
}
|
}
|
||||||
BOOL res = mmReadFile (get_handle (), ptr, len, (DWORD *) &ulen, 0);
|
BOOL res = ReadFile (get_handle (), ptr, len, (DWORD *) &ulen, 0);
|
||||||
if (read_state)
|
if (read_state)
|
||||||
{
|
{
|
||||||
signal_read_state (1);
|
signal_read_state (1);
|
||||||
@ -260,6 +261,19 @@ fhandler_base::raw_read (void *ptr, size_t& ulen)
|
|||||||
bytes_read = 0;
|
bytes_read = 0;
|
||||||
break;
|
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*/
|
/*FALLTHRU*/
|
||||||
case ERROR_INVALID_FUNCTION:
|
case ERROR_INVALID_FUNCTION:
|
||||||
case ERROR_INVALID_PARAMETER:
|
case ERROR_INVALID_PARAMETER:
|
||||||
|
@ -38,7 +38,6 @@
|
|||||||
#include <sys/acl.h>
|
#include <sys/acl.h>
|
||||||
#include "cygtls.h"
|
#include "cygtls.h"
|
||||||
#include "cygwin/in6.h"
|
#include "cygwin/in6.h"
|
||||||
#include "mmap_helper.h"
|
|
||||||
|
|
||||||
#define ASYNC_MASK (FD_READ|FD_WRITE|FD_OOB|FD_ACCEPT|FD_CONNECT)
|
#define ASYNC_MASK (FD_READ|FD_WRITE|FD_OOB|FD_ACCEPT|FD_CONNECT)
|
||||||
#define EVENT_MASK (FD_READ|FD_WRITE|FD_OOB|FD_ACCEPT|FD_CONNECT|FD_CLOSE)
|
#define EVENT_MASK (FD_READ|FD_WRITE|FD_OOB|FD_ACCEPT|FD_CONNECT|FD_CLOSE)
|
||||||
@ -1164,8 +1163,8 @@ fhandler_socket::recv_internal (WSABUF *wsabuf, DWORD wsacnt, DWORD flags,
|
|||||||
while (!(res = wait_for_events (evt_mask | FD_CLOSE))
|
while (!(res = wait_for_events (evt_mask | FD_CLOSE))
|
||||||
|| saw_shutdown_read ())
|
|| saw_shutdown_read ())
|
||||||
{
|
{
|
||||||
res = mmWSARecvFrom (get_socket (), wsabuf, wsacnt, &ret,
|
res = WSARecvFrom (get_socket (), wsabuf, wsacnt, &ret,
|
||||||
&flags, from, fromlen, NULL, NULL);
|
&flags, from, fromlen, NULL, NULL);
|
||||||
if (!res || WSAGetLastError () != WSAEWOULDBLOCK)
|
if (!res || WSAGetLastError () != WSAEWOULDBLOCK)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user