Improve help/man page of para_filter.
[paraslash.git] / exec.c
diff --git a/exec.c b/exec.c
index da7a3568ced41c0b2dc886bcffaa5793f7ca8fd1..bafae240260ef386a1adfc77937fad458a27e40b 100644 (file)
--- a/exec.c
+++ b/exec.c
@@ -37,7 +37,7 @@ static int para_exec(pid_t *pid, const char *file, char *const *const args, int
        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;
@@ -49,7 +49,6 @@ static int para_exec(pid_t *pid, const char *file, char *const *const args, int
        }
        *pid = ret;
        if (!(*pid)) { /* child */
-               close_listed_fds(); /* close unneeded fds */
                if (fds[0] >= 0) {
                        if (fds[0]) {
                                close(in[1]);
@@ -140,8 +139,6 @@ int para_exec_cmdline_pid(pid_t *pid, const char *cmdline, int *fds)
        char **argv;
        char *tmp = para_strdup(cmdline);
 
-       if (!tmp)
-               exit(EXIT_FAILURE);
        argc = split_args(tmp, &argv, " \t");
        ret = para_exec(pid, argv[0], argv, fds);
        free(argv);