summaryrefslogtreecommitdiffstats
path: root/otherlibs/win32unix/write.c
diff options
context:
space:
mode:
Diffstat (limited to 'otherlibs/win32unix/write.c')
-rw-r--r--otherlibs/win32unix/write.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/otherlibs/win32unix/write.c b/otherlibs/win32unix/write.c
index 5c0e54e3d..8571ff679 100644
--- a/otherlibs/win32unix/write.c
+++ b/otherlibs/win32unix/write.c
@@ -34,26 +34,26 @@ CAMLprim value unix_write(value fd, value buf, value vofs, value vlen)
numbytes = len > UNIX_BUFFER_SIZE ? UNIX_BUFFER_SIZE : len;
memmove (iobuf, &Byte(buf, ofs), numbytes);
if (Descr_kind_val(fd) == KIND_SOCKET) {
- int ret;
- SOCKET s = Socket_val(fd);
- enter_blocking_section();
- ret = send(s, iobuf, numbytes, 0);
- leave_blocking_section();
- if (ret == SOCKET_ERROR) {
- win32_maperr(WSAGetLastError());
- uerror("write", Nothing);
- }
- numwritten = ret;
+ int ret;
+ SOCKET s = Socket_val(fd);
+ enter_blocking_section();
+ ret = send(s, iobuf, numbytes, 0);
+ leave_blocking_section();
+ if (ret == SOCKET_ERROR) {
+ win32_maperr(WSAGetLastError());
+ uerror("write", Nothing);
+ }
+ numwritten = ret;
} else {
- BOOL ret;
- HANDLE h = Handle_val(fd);
- enter_blocking_section();
- ret = WriteFile(h, iobuf, numbytes, &numwritten, NULL);
- leave_blocking_section();
- if (! ret) {
- win32_maperr(GetLastError());
- uerror("write", Nothing);
- }
+ BOOL ret;
+ HANDLE h = Handle_val(fd);
+ enter_blocking_section();
+ ret = WriteFile(h, iobuf, numbytes, &numwritten, NULL);
+ leave_blocking_section();
+ if (! ret) {
+ win32_maperr(GetLastError());
+ uerror("write", Nothing);
+ }
}
written += numwritten;
ofs += numwritten;