summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/libfetch/common.c4
-rw-r--r--lib/libfetch/fetch.c1
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/libfetch/common.c b/lib/libfetch/common.c
index e4dbf3a..c03b1f5 100644
--- a/lib/libfetch/common.c
+++ b/lib/libfetch/common.c
@@ -262,7 +262,7 @@ _fetch_getln(int fd, char **buf, size_t *size, size_t *len)
}
r = select(fd+1, &readfds, NULL, NULL, &wait);
if (r == -1) {
- if (errno == EINTR)
+ if (errno == EINTR && fetchRestartCalls)
continue;
/* EBADF or EINVAL: shouldn't happen */
return -1;
@@ -274,7 +274,7 @@ _fetch_getln(int fd, char **buf, size_t *size, size_t *len)
if (r == 0)
break;
if (r == -1) {
- if (errno == EINTR)
+ if (errno == EINTR && fetchRestartCalls)
continue;
/* any other error is bad news */
return -1;
diff --git a/lib/libfetch/fetch.c b/lib/libfetch/fetch.c
index 5d83db5..adb95c9 100644
--- a/lib/libfetch/fetch.c
+++ b/lib/libfetch/fetch.c
@@ -43,6 +43,7 @@
int fetchLastErrCode;
char fetchLastErrString[MAXERRSTRING];
int fetchTimeout;
+int fetchRestartCalls = 1;
/*** Local data **************************************************************/
OpenPOWER on IntegriCloud