handle EINTR returned by connect()

This commit is contained in:
Alexandre Ratchov 2011-10-05 13:12:21 +02:00
parent 6313d1e2bc
commit 979c909719
1 changed files with 3 additions and 0 deletions

View File

@ -353,7 +353,10 @@ aucat_connect_tcp(struct aucat *hdl, char *host, char *unit, int isaudio)
DPERROR("socket");
continue;
}
restart:
if (connect(s, ai->ai_addr, ai->ai_addrlen) < 0) {
if (errno == EINTR)
goto restart;
DPERROR("connect");
close(s);
s = -1;