| 120 | } |
| 121 | |
| 122 | static int |
| 123 | waitForConnection(int listenSock) |
| 124 | { |
| 125 | int fd = accept(listenSock, NULL, NULL); |
| 126 | |
| 127 | if (fd == -1) { |
| 128 | perror("accept failed:"); |
| 129 | exit(DMTCP_FAIL_RC); |
| 130 | } |
| 131 | close(listenSock); |
| 132 | return fd; |
| 133 | } |
| 134 | |
| 135 | // shift args |
| 136 | #define shift argc--, argv++ |