git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: Ramsay Jones <ramsay@ramsay1.demon.co.uk>,
	Junio C Hamano <gitster@pobox.com>,
	GIT Mailing-list <git@vger.kernel.org>
Subject: Re: [PATCH] compat/mingw.[ch]: Change return type of exec functions to int
Date: Thu, 5 Apr 2012 20:44:49 -0400	[thread overview]
Message-ID: <20120406004449.GA15125@sigill.intra.peff.net> (raw)
In-Reply-To: <20120406004226.GA2658@burratino>

On Thu, Apr 05, 2012 at 07:42:26PM -0500, Jonathan Nieder wrote:

> >  	/*
> > +	 * If we are still running, we know an error occurred; let's try to
> > +	 * diagnose it more specifically.
> > +	 *
> >  	 * When a command can't be found because one of the directories
> 
> Looks fine to me. :)

Thanks. Junio, do you mind squashing this onto the tip of
jk/run-command-eaccess? Patch repeated below for your convenience.

This should fix Ramsay's problem, but I think his patch is worth
applying, anyway.

---
diff --git a/run-command.c b/run-command.c
index 7123436..e6ece79 100644
--- a/run-command.c
+++ b/run-command.c
@@ -117,10 +117,12 @@ static int exists_in_PATH(const char *file)
 
 int sane_execvp(const char *file, char * const argv[])
 {
-	if (!execvp(file, argv))
-		return 0;
+	execvp(file, argv);
 
 	/*
+	 * If we are still running, we know an error occurred; let's try to
+	 * diagnose it more specifically.
+	 *
 	 * When a command can't be found because one of the directories
 	 * listed in $PATH is unsearchable, execvp reports EACCES, but
 	 * careful usability testing (read: analysis of occasional bug

  reply	other threads:[~2012-04-06  0:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-05 17:48 [PATCH] compat/mingw.[ch]: Change return type of exec functions to int Ramsay Jones
2012-04-05 18:16 ` Jonathan Nieder
2012-04-05 22:06   ` Jeff King
2012-04-05 22:34     ` Jonathan Nieder
2012-04-06  0:24       ` Jeff King
2012-04-06  0:42         ` Jonathan Nieder
2012-04-06  0:44           ` Jeff King [this message]
2012-04-06  1:00             ` Junio C Hamano

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=20120406004449.GA15125@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jrnieder@gmail.com \
    --cc=ramsay@ramsay1.demon.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).