/*
- * Copyright (C) 2003-2008 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2003-2009 Andre Noll <maan@systemlinux.org>
*
* Licensed under the GPL v2. For licencing details see COPYING.
*/
if (fds[2] > 0 && pipe(err) < 0)
goto err_out;
if (!fds[0] || !fds[1] || !fds[2]) {
- ret = para_open("/dev/null", O_RDONLY, 42);
+ ret = para_open("/dev/null", O_RDWR, 42);
if (ret < 0)
goto err_out;
null = ret;
*/
int para_exec_cmdline_pid(pid_t *pid, const char *cmdline, int *fds)
{
- int argc, ret;
+ int ret;
char **argv;
char *tmp = para_strdup(cmdline);
- if (!tmp)
- exit(EXIT_FAILURE);
- argc = split_args(tmp, &argv, " \t");
+ split_args(tmp, &argv, " \t");
ret = para_exec(pid, argv[0], argv, fds);
free(argv);
free(tmp);