summaryrefslogtreecommitdiffstats
path: root/otherlibs/win32unix/read.c
diff options
context:
space:
mode:
Diffstat (limited to 'otherlibs/win32unix/read.c')
-rw-r--r--otherlibs/win32unix/read.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/otherlibs/win32unix/read.c b/otherlibs/win32unix/read.c
index c87d55ed0..67882eb77 100644
--- a/otherlibs/win32unix/read.c
+++ b/otherlibs/win32unix/read.c
@@ -24,7 +24,7 @@ CAMLprim value unix_read(value fd, value buf, value ofs, value vlen)
intnat len;
DWORD numbytes, numread;
char iobuf[UNIX_BUFFER_SIZE];
- DOWRD errcode = 0;
+ DWORD err = 0;
Begin_root (buf);
len = Long_val(vlen);
@@ -34,18 +34,18 @@ CAMLprim value unix_read(value fd, value buf, value ofs, value vlen)
SOCKET s = Socket_val(fd);
enter_blocking_section();
ret = recv(s, iobuf, numbytes, 0);
- if (ret == SOCKET_ERROR) errcode = WSAGetLastError();
+ if (ret == SOCKET_ERROR) err = WSAGetLastError();
leave_blocking_section();
numread = ret;
} else {
HANDLE h = Handle_val(fd);
enter_blocking_section();
if (! ReadFile(h, iobuf, numbytes, &numread, NULL))
- errcode = GetLastError();
+ err = GetLastError();
leave_blocking_section();
}
- if (errcode) {
- win32_maperr(errcode);
+ if (err) {
+ win32_maperr(err);
uerror("read", Nothing);
}
memmove (&Byte(buf, Long_val(ofs)), iobuf, numread);