This is a fork of Zandronum for TSPG.
Revisión | ad04991924ef3efbbc23415428a4a52d22e9c2be (tree) |
---|---|
Tiempo | 2018-11-03 23:32:06 |
Autor | ![]() |
Commiter | Sean Baggaley |
Undo that, ignore eagain
@@ -90,14 +90,21 @@ | ||
90 | 90 | addr.sun_family = AF_UNIX; |
91 | 91 | strncpy(addr.sun_path, socketAddress, sizeof(addr.sun_path) - 1); |
92 | 92 | |
93 | - if (connect(sock, (struct sockaddr *) &addr, sizeof(addr)) == -1) { | |
94 | - Printf("Failed to connect to socket %s: (%d) %s.\n", socketAddress, errno, strerror(errno)); | |
95 | - return; | |
96 | - } | |
97 | - | |
98 | 93 | int flags = fcntl(sock, F_GETFL, 0); |
99 | 94 | fcntl(sock, F_SETFL, flags | O_NONBLOCK); |
100 | 95 | |
96 | + if (connect(sock, (struct sockaddr *) &addr, sizeof(addr)) == -1) { | |
97 | + if (errno == EAGAIN || errno == EWOULDBLOCK) | |
98 | + { | |
99 | + // do nothing | |
100 | + } | |
101 | + else | |
102 | + { | |
103 | + Printf("Failed to connect to socket %s: (%d) %s.\n", socketAddress, errno, strerror(errno)); | |
104 | + return; | |
105 | + } | |
106 | + } | |
107 | + | |
101 | 108 | isConnected = true; |
102 | 109 | sendFail = false; |
103 | 110 | } |