projects
/
paraslash.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' into next
[paraslash.git]
/
exec.c
diff --git
a/exec.c
b/exec.c
index bafae240260ef386a1adfc77937fad458a27e40b..b603809d062ee07724f7a4f25b9629ff227f047d 100644
(file)
--- a/
exec.c
+++ b/
exec.c
@@
-1,16
+1,19
@@
/*
/*
- * Copyright (C) 2003-200
8
Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2003-200
9
Andre Noll <maan@systemlinux.org>
*
* Licensed under the GPL v2. For licencing details see COPYING.
*/
/** \file exec.c Helper functions for spawning new processes. */
*
* Licensed under the GPL v2. For licencing details see COPYING.
*/
/** \file exec.c Helper functions for spawning new processes. */
+
+#include <regex.h>
#include <dirent.h>
#include <dirent.h>
+
#include "para.h"
#include "close_on_fork.h"
#include "error.h"
#include "para.h"
#include "close_on_fork.h"
#include "error.h"
-#include "string.h"
#include "fd.h"
#include "fd.h"
+#include "string.h"
/**
* Spawn a new process and redirect fd 0, 1, and 2.
/**
* Spawn a new process and redirect fd 0, 1, and 2.
@@
-135,13
+138,13
@@
err_out:
*/
int para_exec_cmdline_pid(pid_t *pid, const char *cmdline, int *fds)
{
*/
int para_exec_cmdline_pid(pid_t *pid, const char *cmdline, int *fds)
{
- int
argc,
ret;
+ int ret;
char **argv;
char **argv;
- char *tmp = para_strdup(cmdline);
- argc = split_args(tmp, &argv, " \t");
+ ret = create_argv(cmdline, " \t", &argv);
+ if (ret < 0)
+ return ret;
ret = para_exec(pid, argv[0], argv, fds);
ret = para_exec(pid, argv[0], argv, fds);
- free(argv);
- free(tmp);
+ free_argv(argv);
return ret;
}
return ret;
}