mirror of
https://github.com/git/git.git
synced 2026-03-13 10:23:30 +01:00
spawnvppe_pipe(): Don't die on error, some callers want to handle it.
This commit is contained in:
@@ -624,8 +624,11 @@ static void git_proxy_connect(int fd[2], char *host)
|
||||
|
||||
{
|
||||
const char *argv[] = { NULL, host, port, NULL };
|
||||
spawnvpe_pipe(git_proxy_command, argv, environ, pipefd[1], pipefd[0]);
|
||||
pid = spawnvpe_pipe(git_proxy_command, argv, environ,
|
||||
pipefd[1], pipefd[0]);
|
||||
}
|
||||
if (pid < 0)
|
||||
die("fork failed");
|
||||
fd[0] = pipefd[0][0];
|
||||
fd[1] = pipefd[1][1];
|
||||
}
|
||||
@@ -761,6 +764,8 @@ pid_t git_connect(int fd[2], char *url, const char *prog)
|
||||
env_unsetenv(env, INDEX_ENVIRONMENT);
|
||||
pid = spawnvpe_pipe("sh", argv, env, pipefd[1], pipefd[0]);
|
||||
}
|
||||
if (pid < 0)
|
||||
die("unable to fork");
|
||||
fd[0] = pipefd[0][0];
|
||||
fd[1] = pipefd[1][1];
|
||||
if (free_path)
|
||||
|
||||
2
diff.c
2
diff.c
@@ -1500,6 +1500,8 @@ static int spawn_prog(const char *pgm, const char **arg)
|
||||
|
||||
fflush(NULL);
|
||||
pid = spawnvpe_pipe(pgm, arg, environ, NULL, NULL);
|
||||
if (pid < 0)
|
||||
die("unable to fork");
|
||||
|
||||
while (waitpid(pid, &status, 0) < 0) {
|
||||
if (errno == EINTR)
|
||||
|
||||
@@ -11,6 +11,9 @@ static void run_program(void)
|
||||
pid_t pid = spawnvpe_pipe(pgm, arguments, environ, NULL, NULL);
|
||||
int status;
|
||||
|
||||
if (pid < 0)
|
||||
die("unable to fork");
|
||||
|
||||
if (waitpid(pid, &status, 0) < 0 || !WIFEXITED(status) || WEXITSTATUS(status)) {
|
||||
if (one_shot) {
|
||||
err++;
|
||||
|
||||
@@ -198,9 +198,6 @@ int spawnvppe_pipe(const char *cmd, const char **argv, const char **env,
|
||||
pid = spawnvpe(_P_NOWAIT, interpr, qargv, env);
|
||||
}
|
||||
|
||||
if (pid < 0)
|
||||
die("unable to run %s", cmd);
|
||||
|
||||
free(qargv); /* TODO: quoted args should be freed, too */
|
||||
free(prog);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user