rem: close(pipeError[0]);
add: close(errpipe[0]);
context: Ns_ExecArgv(char *exec, char *dir, int fdin, int fdout,	    char **argv, Ns_Set *env){    int             pid;#ifdef WIN32    /*     * Win32 ExecArgv simply calls ExecArgblk.     */         Ns_DString      ds;    char           *argblk;    int		    i;    Ns_DStringInit(&ds);    if (argv == NULL) {        argblk = NULL;    } else {        for (i = 0; argv[i] != NULL; ++i) {            Ns_DStringNAppend(&ds, argv[i], strlen(argv[i]) + 1);        }        argblk = ds.string;    }    pid = Ns_ExecArgblk(exec, dir, fdin, fdout, argblk, env);    Ns_DStringFree(&ds);#else    int    pipeError[2];    int    nread;    char   cBuf[200];    char  *envBlock;    char **envp;    char  *argvSh[4];    if (exec == NULL) {        Ns_Log(Bug, "exec: null command given to child process");        return -1;    }    if (argv == NULL) {        argv = argvSh;        argv[0] = "/bin/sh";        argv[1] = "-c";        argv[2] = exec;        argv[3] = NULL;        exec = argv[0];    }    if (ns_pipe(pipeError) < 0) {        Ns_Log(Error, "exec: failed to create pipe for '%s': '%s'",	       exec, strerror(errno));        return -1;    }    if (env != NULL) {        envBlock = GetEnvBlock(env);        envp = BuildVector(envBlock);    }    if (fdin < 0) {	fdin = 0;    }    if (fdout < 0) {	fdout = 1;    }    pid = ns_fork();    if (pid < 0) {        Ns_Log(Error, "exec: failed to fork '%s': '%s'", exec, strerror(errno));        close(pipeError[0]);        close(pipeError[1]);    } else if (pid == 0) {	/* child */        close(pipeError[0]);        if (dir != NULL && chdir(dir) != 0) {            ExecFailed(pipeError[1], cBuf, "%dchdir(\"%.150s\")", errno, dir);        }	if (fdin == 1) {	    fdin = dup(1);            if (fdin == -1) {                ExecFailed(pipeError[1], cBuf, "%ddup(1)", errno);            }	}	if (fdout == 0) {	    fdout = dup(0);            if (fdout == -1) {                ExecFailed(pipeError[1], cBuf, "%ddup(0)", errno);            }	}        if (fdin != 0) {            if (dup2(fdin, 0) == -1) {                ExecFailed(pipeError[1], cBuf, "%ddup2(%d, 0)", errno, fdin);            }	    if (fdin != fdout) {		close(fdin);	    }        }        if (fdout != 1) {            if (dup2(fdout, 1) == -1) {                ExecFailed(pipeError[1], cBuf, "%ddup2(%d, 1)", errno, fdout);            }            close(fdout);        }        NsRestoreSignals();	Ns_NoCloseOnExec(0);	Ns_NoCloseOnExec(1);	Ns_NoCloseOnExec(2);        if (env != NULL) {            execve(exec, argv, envp);        } else {            execv(exec, argv);        }        ExecFailed(pipeError[1], cBuf, "%dexecv()", errno);	    } else {	/* parent */	        close(pipeError[1]);        nread = read(pipeError[0], cBuf, sizeof(cBuf) - 1);        close(pipeError[0]);        if (nread != 0) {            if (nread < 0) {		Ns_Log(Error, "exec: "		       "error reading from process '%s' (pid %d): '%s'",		       exec, pid, strerror(errno));            } else if (nread > 0) {                char *msg;		int   err;		                cBuf[nread] = '\0';                err = strtol(cBuf, &msg, 10);                Ns_Log(Error, "exec: "		       "failed to execute '%s': failed to read '%s': '%s'",		       exec, msg, strerror(err));            }            waitpid(pid, NULL, 0);            pid = -1;        }    }    if (env != NULL) {        ns_free(envp);        ns_free(envBlock);    }#endif    return pid;}