/* $Id$
This file is part of builder
-Copyright © 2006-2007 Mikko Rasa, Mikkosoft Productions
+Copyright © 2006-2009 Mikko Rasa, Mikkosoft Productions
Distributed under the LGPL
*/
using namespace std;
using namespace Msp;
-int ExternalAction::check()
-{
- if(builder.get_dry_run())
- {
- signal_done.emit();
- return 0;
- }
-
- if(!pid)
- return exit_code;
-
- int status;
- if(waitpid(pid, &status, WNOHANG)==pid)
- {
- signal_done.emit();
- if(WIFEXITED(status))
- 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)
pid=0;
}
}
+
+int ExternalAction::check()
+{
+ if(builder.get_dry_run())
+ {
+ signal_done.emit();
+ return 0;
+ }
+
+ if(!pid)
+ return exit_code;
+
+ int status;
+ if(waitpid(pid, &status, WNOHANG)==pid)
+ {
+ signal_done.emit();
+ if(WIFEXITED(status))
+ exit_code=WEXITSTATUS(status);
+ else
+ exit_code=254;
+ pid=0;
+ return exit_code;
+ }
+ else
+ return -1;
+}