summaryrefslogtreecommitdiffstats
path: root/otherlibs/win32unix/accept.c
diff options
context:
space:
mode:
authorDamien Doligez <damien.doligez-inria.fr>1997-05-26 17:16:31 +0000
committerDamien Doligez <damien.doligez-inria.fr>1997-05-26 17:16:31 +0000
commit8555ce8fe79fbf54924845a608054306733eeeba (patch)
treedd5b22190a08dcf3c1d8c16adc89988b60d982f1 /otherlibs/win32unix/accept.c
parentff13e60cd68933428c60c10680c82c3cd91ea8c2 (diff)
Changement de Push/Pop_roots en Begin/End_roots
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1572 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'otherlibs/win32unix/accept.c')
-rw-r--r--otherlibs/win32unix/accept.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/otherlibs/win32unix/accept.c b/otherlibs/win32unix/accept.c
index 6b6633b85..cbd7e1ed0 100644
--- a/otherlibs/win32unix/accept.c
+++ b/otherlibs/win32unix/accept.c
@@ -25,30 +25,30 @@ value unix_accept(sock) /* ML */
int fd;
int optionValue;
HANDLE h;
- Push_roots(a,1);
-
+ value adr = Val_unit;
/* Set sockets to synchronous mode */
optionValue = SO_SYNCHRONOUS_NONALERT;
setsockopt(INVALID_SOCKET, SOL_SOCKET, SO_OPENTYPE,
(char *)&optionValue, sizeof(optionValue));
-
- sock_addr_len = sizeof(sock_addr);
- enter_blocking_section();
- s = accept((SOCKET) _get_osfhandle(Int_val(sock)),
- &sock_addr.s_gen, &sock_addr_len);
- leave_blocking_section();
- if (s == INVALID_SOCKET) {
- _dosmaperr(WSAGetLastError());
- uerror("accept", Nothing);
- };
- a[0] = alloc_sockaddr();
- res = alloc_tuple(2);
- fd = _open_osfhandle(s, 0);
- if (fd == -1) uerror("accept", Nothing);
- Field(res, 0) = Val_int(fd);
- Field(res, 1) = a[0];
- Pop_roots();
+
+ Begin_root (adr);
+ sock_addr_len = sizeof(sock_addr);
+ enter_blocking_section();
+ s = accept((SOCKET) _get_osfhandle(Int_val(sock)),
+ &sock_addr.s_gen, &sock_addr_len);
+ leave_blocking_section();
+ if (s == INVALID_SOCKET) {
+ _dosmaperr(WSAGetLastError());
+ uerror("accept", Nothing);
+ }
+ adr = alloc_sockaddr();
+ res = alloc_tuple(2);
+ fd = _open_osfhandle(s, 0);
+ if (fd == -1) uerror("accept", Nothing);
+ Field(res, 0) = Val_int(fd);
+ Field(res, 1) = adr;
+ End_roots();
return res;
}