Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

uv: upgrade to 5b8a112

  • Loading branch information...
commit 3644b0bc9637fbb17ec74b41fe2dcb1dd978699e 1 parent c721604
Isaac Z. Schlueter isaacs authored
3  deps/uv/common.gypi
@@ -32,6 +32,9 @@
32 32 'LinkIncremental': 2, # enable incremental linking
33 33 },
34 34 },
  35 + 'xcode_settings': {
  36 + 'GCC_OPTIMIZATION_LEVEL': '0',
  37 + },
35 38 'conditions': [
36 39 ['OS != "win"', {
37 40 'defines': [ 'EV_VERIFY=2' ],
8 deps/uv/src/unix/core.c
@@ -426,6 +426,11 @@ int uv__accept(int sockfd) {
426 426
427 427 while (1) {
428 428 #if __linux__
  429 + static int no_accept4;
  430 +
  431 + if (no_accept4)
  432 + goto skip;
  433 +
429 434 peerfd = uv__accept4(sockfd,
430 435 NULL,
431 436 NULL,
@@ -439,6 +444,9 @@ int uv__accept(int sockfd) {
439 444
440 445 if (errno != ENOSYS)
441 446 break;
  447 +
  448 + no_accept4 = 1;
  449 +skip:
442 450 #endif
443 451
444 452 peerfd = accept(sockfd, NULL, NULL);
26 deps/uv/src/unix/linux/syscalls.c
@@ -152,13 +152,25 @@
152 152
153 153 int uv__accept4(int fd, struct sockaddr* addr, socklen_t* addrlen, int flags) {
154 154 #if __i386__
155   - unsigned long args[] = {
156   - (unsigned long) fd,
157   - (unsigned long) addr,
158   - (unsigned long) addrlen,
159   - (unsigned long) flags
160   - };
161   - return syscall(__NR_socketcall, 18 /* SYS_ACCEPT4 */, args);
  155 + unsigned long args[4];
  156 + int r;
  157 +
  158 + args[0] = (unsigned long) fd;
  159 + args[1] = (unsigned long) addr;
  160 + args[2] = (unsigned long) addrlen;
  161 + args[3] = (unsigned long) flags;
  162 +
  163 + r = syscall(__NR_socketcall, 18 /* SYS_ACCEPT4 */, args);
  164 +
  165 + /* socketcall() raises EINVAL when SYS_ACCEPT4 is not supported but so does
  166 + * a bad flags argument. Try to distinguish between the two cases.
  167 + */
  168 + if (r == -1)
  169 + if (errno == EINVAL)
  170 + if ((flags & ~(UV__SOCK_CLOEXEC|UV__SOCK_NONBLOCK)) == 0)
  171 + errno = ENOSYS;
  172 +
  173 + return r;
162 174 #elif __NR_accept4
163 175 return syscall(__NR_accept4, fd, addr, addrlen, flags);
164 176 #else

0 comments on commit 3644b0b

Please sign in to comment.
Something went wrong with that request. Please try again.