diff options
| author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2026-02-21 01:18:15 +0000 |
|---|---|---|
| committer | Colin Percival <cperciva@FreeBSD.org> | 2026-02-26 18:00:38 +0000 |
| commit | ca76ec7c4e563292a0c75781683b0421a4439a02 (patch) | |
| tree | 845357d15a2e6747021ffdc4dd49c250708ce404 /lib | |
| parent | 3cf73e195af3d4693d1e52de0a91b6d4b3fb8b5c (diff) | |
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/libfetch/common.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/libfetch/common.c b/lib/libfetch/common.c index bdc72f67c9a0..949addd8e6e2 100644 --- a/lib/libfetch/common.c +++ b/lib/libfetch/common.c @@ -658,7 +658,13 @@ fetch_connect(const char *host, int port, int af, int verbose) goto syserr; } /* attempt to connect to server address */ - if ((err = connect(sd, sai->ai_addr, sai->ai_addrlen)) == 0) + while ((err = connect(sd, sai->ai_addr, sai->ai_addrlen)) < 0) { + if (errno == EINTR && fetchRestartCalls) + continue; + break; + } + /* success? */ + if (err == 0) break; /* clean up before next attempt */ close(sd); |
