Commit 022abe6
committed
Make TCP connect handle EINTR correctly
According to the POSIX standard, if connect() is interrupted by a
signal that is caught while blocked waiting to establish a connection,
connect() shall fail and set errno to EINTR, but the connection
request shall not be aborted, and the connection shall be established
asynchronously.
When connect() is called one more time to handle EINTR error, it
can already be established asynchronously and errno would be set
to EISCONN. This case should be handled and not produce an error.1 parent 42ca6e4 commit 022abe6
1 file changed
+11
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
323 | 323 | | |
324 | 324 | | |
325 | 325 | | |
326 | | - | |
327 | | - | |
328 | | - | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
329 | 336 | | |
| 337 | + | |
330 | 338 | | |
331 | 339 | | |
332 | 340 | | |
| |||
0 commit comments