X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fexternalaction.cpp;h=97f6c619f426cb16e50cef20aa170e2008b86ea7;hb=57bdb055acb0453c75b22cb64f35cc0e817a2827;hp=b86d8028da25636e5677f00e5eb1763df6a17a94;hpb=1a46151c99a406123c4ddfc797a7841baf3e4cc2;p=builder.git diff --git a/source/externalaction.cpp b/source/externalaction.cpp index b86d802..97f6c61 100644 --- a/source/externalaction.cpp +++ b/source/externalaction.cpp @@ -16,7 +16,7 @@ int ExternalAction::check() } if(!pid) - return 255; + return exit_code; int status; if(waitpid(pid, &status, WNOHANG)==pid) @@ -26,12 +26,16 @@ int ExternalAction::check() exit_code=WEXITSTATUS(status); else exit_code=254; + pid=0; return exit_code; } else return -1; } +/** +Starts the external program. Fill in argv before calling this. +*/ void ExternalAction::launch() { if(builder.get_verbose()>=2) @@ -57,6 +61,7 @@ void ExternalAction::launch() argv_[i.count()]=strdup(i->c_str()); argv_[argv.size()]=0; execvp(argv_[0], argv_); + cout<<"Couldn't execute "<