Re: [PATCH] compat/mingw.[ch]: Change return type of exec functions to int
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Apr 5, 2012, 18:16 UTC
- Message-ID
- <20120405181600.GA6340@burratino>
- In-Reply-To
- <4F7DDAFE.1060902@ramsay1.demon.co.uk>
Ramsay Jones wrote:
Show 11 quoted lines
> CC run-command.o > run-command.c: In function 'sane_execvp': > run-command.c:124: error: invalid use of void expression > make: *** [run-command.o] Error 1 > > My first reaction was to simply remove the conditional since, if execvp() > returns at all, the result will always be -1 and so the condition will > always be false. ie. the conditional is pointless. > > However, I found the incorrect return type of the mingw_execv[p]() to be > a gratuitous incompatibility, so ... :-P
My bad. I agree that in addition to making the return type fix, squashing the following into jk/run-command-eacces would be a good idea.
diff --git i/run-command.c w/run-command.c index 04f0190d..fcd7e192 100644 --- i/run-command.c +++ w/run-command.c @@ -59,8 +59,7 @@ 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); /* * When a command can't be found because one of the directories