Re: [PATCH] connect.c: finish_connect(): allow null pid parameter

From: Junio C Hamano <junkio@cox.net>
Date: 2006-09-13 14:48:28
Franck Bui-Huu <vagabon.xyz@gmail.com> writes:

> git_connect() can return 0 if we use git protocol for example.
> Users of this function don't know and don't care if a process
> had been created or not, and to avoid them to check it before
> calling finish_connect() this patch allows finish_connect() to
> take a null pid. And in that case return 0.
>
> Signed-off-by: Franck Bui-Huu <vagabon.xyz@gmail.com>
> ---
>
>  Found it when debugging 'git archive --remote=git://...'
>  command. I noticed that this command always exited with 1 as
>  status.

True.  This should affect existing users of finish_connect(), but
existing callers do not check its return value X-<.

I think the return type of git_connect() should be changed to
pid_t with a warning that says it returns negative on error, pid
of a process finish_connect() should wait for if the underlying
protocol driver forks, and 0 if we do not have to wait in
finish_connect().  Making finish_connect() to accept 0 as its
input is probably a good change.

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Wed Sep 13 14:48:31 2006

This archive was generated by hypermail 2.1.8 : 2006-09-13 14:49:14 EST