--- parser3/src/main/pa_exec.C 2002/08/01 11:26:50 1.38 +++ parser3/src/main/pa_exec.C 2002/11/22 10:28:42 1.45 @@ -7,7 +7,7 @@ @todo setrlimit */ -static const char* IDENT_EXEC_C="$Id: pa_exec.C,v 1.38 2002/08/01 11:26:50 paf Exp $"; +static const char* IDENT_EXEC_C="$Date: 2002/11/22 10:28:42 $"; #include "pa_config_includes.h" @@ -235,7 +235,8 @@ static int execve_piped(const char *file close(err_fds[1]); } - /* HP-UX SIGCHLD fix goes here, if someone will remind me what it is... */ + /* grabbed this from Apache source: */ + /* HP-UX SIGCHLD fix goes here, if someone will remind me what it is... */ signal(SIGCHLD, SIG_DFL); /* Was that it? */ // chdir to script's directory @@ -280,8 +281,8 @@ static int get_exit_status(int pid) { static void read_pipe(String& result, int file, const char *file_spec, String::Untaint_lang lang){ while(true) { char *buf=(char *)result.pool().malloc(MAX_STRING); - size_t size=read(file, buf, MAX_STRING); - if(!size) + ssize_t size=read(file, buf, MAX_STRING); + if(size<=0) break; result.APPEND(buf, size, lang, file_spec, 0); } @@ -301,7 +302,7 @@ static void append_env_pair(const Hash:: string << key << "=" << *static_cast(value); char ***env_ref=static_cast(info); - **env_ref=string.cstr(); (*env_ref)++; + **env_ref=string.cstr(String::UL_UNSPECIFIED); (*env_ref)++; #endif } @@ -330,7 +331,7 @@ int pa_exec( if(env) { String string(env->pool()); env->for_each(append_env_pair, &string); - env_cstr=string.cstr(); + env_cstr=string.cstr(String::UL_UNSPECIFIED); } if(DWORD error=CreateHiddenConsoleProcess(cmd, env_cstr, &pi, &hInWrite, &hOutRead, &hErrRead)) { char szErrorDesc[MAX_STRING]; @@ -419,7 +420,8 @@ from http://www.apache.org/websrc/cvsweb if(pid) { // in child const char *in_cstr=in.cstr(); - write(pipe_write, in_cstr, in.size()); + if(*in_cstr) // there is some in data + write(pipe_write, in_cstr, in.size()); close(pipe_write); read_pipe(out, pipe_read, file_spec_cstr, String::UL_AS_IS); close(pipe_read);