3 This file is part of builder
4 Copyright © 2006-2007 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
12 #include <msp/fs/dir.h>
14 #include "externalaction.h"
19 int ExternalAction::check()
21 if(builder.get_dry_run())
31 if(waitpid(pid, &status, WNOHANG)==pid)
35 exit_code=WEXITSTATUS(status);
46 Starts the external program. Fill in argv before calling this.
48 void ExternalAction::launch()
50 if(builder.get_verbose()>=2)
52 for(StringList::const_iterator i=argv.begin(); i!=argv.end(); ++i)
61 if(builder.get_dry_run())
68 char *argv_[argv.size()+1];
71 for(StringList::iterator i=argv.begin(); i!=argv.end(); ++i)
72 argv_[j++]=strdup(i->c_str());
77 execvp(argv_[0], argv_);
78 cout<<"Couldn't execute "<<argv.front()<<'\n';