summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--connect.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/connect.c b/connect.c
index 4422a0d..b9c2220 100644
--- a/connect.c
+++ b/connect.c
@@ -737,14 +737,9 @@ int git_connect(int fd[2], char *url, const char *prog)
int finish_connect(pid_t pid)
{
- int ret;
-
- for (;;) {
- ret = waitpid(pid, NULL, 0);
- if (!ret)
- break;
+ while (waitpid(pid, NULL, 0) < 0) {
if (errno != EINTR)
- break;
+ return -1;
}
- return ret;
+ return 0;
}