summaryrefslogtreecommitdiff
path: root/merge-index.c
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2007-03-12 19:00:21 -0400
committerJunio C Hamano <junkio@cox.net>2007-03-12 23:40:18 -0700
commitb49809c9615e7d2b854ce88b3dd0cd7790588fe5 (patch)
tree53aca6946571f98dc5b9c829b48fcf76b0034eb6 /merge-index.c
parent15a1c012635f2f57a8f0146e198b5e1334d527cf (diff)
downloadgit-b49809c9615e7d2b854ce88b3dd0cd7790588fe5.tar.gz
Use run_command within merge-index
Maybe unnecessary as the merge-index utility may go away in the future, but its currently here, its shorter to use run_command, and probably will help the MinGW port out. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'merge-index.c')
-rw-r--r--merge-index.c23
1 files changed, 5 insertions, 18 deletions
diff --git a/merge-index.c b/merge-index.c
index 7027d78659..6df43944b0 100644
--- a/merge-index.c
+++ b/merge-index.c
@@ -1,4 +1,5 @@
#include "cache.h"
+#include "run-command.h"
static const char *pgm;
static const char *arguments[8];
@@ -7,24 +8,10 @@ static int err;
static void run_program(void)
{
- pid_t pid = fork();
- int status;
-
- if (pid < 0)
- die("unable to fork");
- if (!pid) {
- execlp(pgm, arguments[0],
- arguments[1],
- arguments[2],
- arguments[3],
- arguments[4],
- arguments[5],
- arguments[6],
- arguments[7],
- NULL);
- die("unable to execute '%s'", pgm);
- }
- if (waitpid(pid, &status, 0) < 0 || !WIFEXITED(status) || WEXITSTATUS(status)) {
+ struct child_process child;
+ memset(&child, 0, sizeof(child));
+ child.argv = arguments;
+ if (run_command(&child)) {
if (one_shot) {
err++;
} else {