check for error return from fork()

Trivial fixup for fork() callsites which do not check for errors.

Signed-off-by: Paul T Darga <pdarga@umich.edu>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Paul T Darga
2006-06-08 14:14:47 -04:00
committed by Junio C Hamano
parent fb6a9f93d3
commit c9bc159d7f
3 changed files with 12 additions and 2 deletions

View File

@ -657,6 +657,8 @@ int git_connect(int fd[2], char *url, const char *prog)
if (pipe(pipefd[0]) < 0 || pipe(pipefd[1]) < 0)
die("unable to create pipe pair for communication");
pid = fork();
if (pid < 0)
die("unable to fork");
if (!pid) {
snprintf(command, sizeof(command), "%s %s", prog,
sq_quote(path));