X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=connect.c;h=7a6a73f2a333d067c5a5442004f76ebbb9aaed17;hb=3899e7a329aabfc22eca9beb82599e1bb214b3d2;hp=4422a0d8d38c225c6c4716ce8ff826bc1acbd981;hpb=b296990c3bcf942dc7601b31a901c7714a353a0a;p=git.git diff --git a/connect.c b/connect.c index 4422a0d8d..7a6a73f2a 100644 --- a/connect.c +++ b/connect.c @@ -10,7 +10,7 @@ #include #include -static char *server_capabilities = NULL; +static char *server_capabilities; static int check_ref(const char *name, int len, unsigned int flags) { @@ -493,8 +493,8 @@ static void git_tcp_connect(int fd[2], char *host) } -static char *git_proxy_command = NULL; -static const char *rhost_name = NULL; +static char *git_proxy_command; +static const char *rhost_name; static int rhost_len; static int git_proxy_command_options(const char *var, const char *value) @@ -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; }