public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox•net>
To: "Shawn O. Pearce" <spearce@spearce•org>
Cc: git@vger•kernel.org, Johannes Schindelin <Johannes.Schindelin@gmx•de>
Subject: Re: [PATCH 4/4] Replace fork_with_pipe in bundle with run_command
Date: Mon, 12 Mar 2007 16:57:12 -0700	[thread overview]
Message-ID: <7vslcaow13.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <20070312183815.GD15996@spearce.org> (Shawn O. Pearce's message of "Mon, 12 Mar 2007 14:38:15 -0400")

"Shawn O. Pearce" <spearce@spearce•org> writes:

> Now that the run_command family supports all of the redirection
> modes needed by builtin-bundle, we can use those functions rather
> than the underlying POSIX primitives.  This should help to make the
> bundle command slightly more portable to other systems, like Windows.
>
> Signed-off-by: Shawn O. Pearce <spearce@spearce•org>
> ...
> @@ -263,9 +202,10 @@ static int create_bundle(struct bundle_header *header, const char *path,
>  	int bundle_fd = -1;
>  	const char **argv_boundary = xmalloc((argc + 4) * sizeof(const char *));
>  	const char **argv_pack = xmalloc(5 * sizeof(const char *));
> -	int pid, in, out, i, status, ref_count = 0;
> +	int i, status, ref_count = 0;
>  	char buffer[1024];
>  	struct rev_info revs;
> +	struct child_process rls;
>  
>  	bundle_fd = (!strcmp(path, "-") ? 1 :
>  			open(path, O_CREAT | O_EXCL | O_WRONLY, 0666));
> ...
>  			write_or_die(bundle_fd, buffer, i);
> @@ -303,11 +245,8 @@ static int create_bundle(struct bundle_header *header, const char *path,
>  			object->flags |= SHOWN;
>  		}
>  	}
> -	while ((i = waitpid(pid, &status, 0)) < 0)
> -		if (errno != EINTR)
> -			return error("rev-list died");
> -	if (!WIFEXITED(status) || WEXITSTATUS(status))
> -		return error("rev-list died %d", WEXITSTATUS(status));
> +	if (finish_command(&rls))
> +		return error("rev-list died");
> ...
> +	if (finish_command(&rls))
>  		return error ("pack-objects died");
>  
>  	return status;

As the variable 'status' is not used anymore, I think this should return 0.

  reply	other threads:[~2007-03-12 23:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-12 18:38 [PATCH 4/4] Replace fork_with_pipe in bundle with run_command Shawn O. Pearce
2007-03-12 23:57 ` Junio C Hamano [this message]
2007-03-13  0:36   ` Shawn O. Pearce
2007-03-13  0:54     ` Junio C Hamano
2007-03-13  0:56       ` Shawn O. Pearce

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vslcaow13.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox$(echo .)net \
    --cc=Johannes.Schindelin@gmx$(echo .)de \
    --cc=git@vger$(echo .)kernel.org \
    --cc=spearce@spearce$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox