summaryrefslogtreecommitdiffstats
path: root/otherlibs/win32unix/read.c
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>2006-10-18 08:26:54 +0000
committerXavier Leroy <xavier.leroy@inria.fr>2006-10-18 08:26:54 +0000
commit4af5727d181e7a77b358751202246382d8aefba6 (patch)
tree799fb5078428bb524da81f9a7f8169bddd8856fd /otherlibs/win32unix/read.c
parent35d863e204eb61c4d7c1b141e6c6b9a4172dceb0 (diff)
PR#4097: suite
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@7697 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
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);