]> git.tdb.fi Git - builder.git/blobdiff - source/externalaction.cpp
Reorder class members
[builder.git] / source / externalaction.cpp
index 5d01f4f701071fd4b330b26618b897899a59110d..88c7e544e7907671daa82a6d8381f29f46257356 100644 (file)
@@ -1,7 +1,7 @@
 /* $Id$
 
 This file is part of builder
-Copyright © 2006-2007 Mikko Rasa, Mikkosoft Productions
+Copyright © 2006-200 Mikko Rasa, Mikkosoft Productions
 Distributed under the LGPL
 */
 
@@ -16,35 +16,6 @@ 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)
@@ -82,3 +53,29 @@ void ExternalAction::launch()
                        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;
+}