| 673:144bdc33fdb6 | 674:6a031133a498 |
|---|---|
| 85 } | 85 } |
| 86 | 86 |
| 87 return fd; | 87 return fd; |
| 88 } | 88 } |
| 89 | 89 |
| 90 int util_socketpair(int fds[2]) { | |
| 91 if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds)) { | |
| 92 fds[0] = -1; | |
| 93 fds[1] = -1; | |
| 94 return -1; | |
| 95 } | |
| 96 return 0; | |
| 97 } | |
| 98 | |
| 90 int util_socket_setnonblock(int fd, int nonblock) { | 99 int util_socket_setnonblock(int fd, int nonblock) { |
| 91 int flags; | 100 int flags; |
| 92 if ((flags = fcntl(fd, F_GETFL, 0)) == -1) { | 101 if ((flags = fcntl(fd, F_GETFL, 0)) == -1) { |
| 93 flags = 0; | 102 flags = 0; |
| 94 } | 103 } |