3 This file is part of builder
4 Copyright © 2006-2007 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
10 #include <msp/path/utils.h>
12 #include "externalaction.h"
17 int ExternalAction::check()
19 if(builder.get_dry_run())
29 if(waitpid(pid, &status, WNOHANG)==pid)
33 exit_code=WEXITSTATUS(status);
44 Starts the external program. Fill in argv before calling this.
46 void ExternalAction::launch()
48 if(builder.get_verbose()>=2)
50 for(StringList::const_iterator i=argv.begin(); i!=argv.end(); ++i)
59 if(builder.get_dry_run())
66 char *argv_[argv.size()+1];
69 for(StringList::iterator i=argv.begin(); i!=argv.end(); ++i)
70 argv_[j++]=strdup(i->c_str());
75 execvp(argv_[0], argv_);
76 cout<<"Couldn't execute "<<argv.front()<<'\n';