--- parser3/src/main/pa_exec.C 2016/12/24 23:07:50 1.90 +++ parser3/src/main/pa_exec.C 2020/12/22 23:11:49 1.95 @@ -1,7 +1,7 @@ /** @file Parser: program executing for different OS-es. - Copyright (c) 2001-2015 Art. Lebedev Studio (http://www.artlebedev.com) + Copyright (c) 2001-2020 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) @todo setrlimit @@ -13,7 +13,7 @@ #include "pa_exception.h" #include "pa_common.h" -volatile const char * IDENT_PA_EXEC_C="$Id: pa_exec.C,v 1.90 2016/12/24 23:07:50 moko Exp $" IDENT_PA_EXEC_H; +volatile const char * IDENT_PA_EXEC_C="$Id: pa_exec.C,v 1.95 2020/12/22 23:11:49 moko Exp $" IDENT_PA_EXEC_H; #ifdef _MSC_VER @@ -167,7 +167,7 @@ static void read_pipe(File_read_result& static const char* buildCommand(const char* file_spec_cstr, const ArrayString& argv) { const char* result=file_spec_cstr; - if(FILE *f=fopen(file_spec_cstr, "r")) { + if(FILE *f=pa_fopen(file_spec_cstr, "r")) { try { char buf[MAX_STRING]; size_t size=fread(buf, 1, MAX_STRING-1, f); @@ -313,7 +313,7 @@ static pid_t execve_piped(const char* fi } static int get_exit_status(int pid) { - int status; + int status=0; pid_t cid; while ((cid=waitpid(pid, &status, WUNTRACED)) == -1 && errno == EINTR); if(!cid) @@ -442,7 +442,7 @@ PA_exec_result pa_exec(bool forced_allow if(!forced_allow) { struct stat finfo; - if(stat(file_spec_cstr, &finfo)!=0) + if(pa_stat(file_spec_cstr, &finfo)!=0) throw Exception("file.missing", &file_spec, "stat failed: %s (%d), actual filename '%s'", strerror(errno), errno, file_spec_cstr); check_safe_mode(finfo, file_spec, file_spec_cstr);