]> git.tdb.fi Git - builder.git/blobdiff - source/externalaction.cpp
Use mspio for all I/O operations
[builder.git] / source / externalaction.cpp
index 88c7e544e7907671daa82a6d8381f29f46257356..7e0a23de5021bcd7f3211fe201e7f85169727106 100644 (file)
@@ -5,11 +5,12 @@ Copyright © 2006-2009  Mikko Rasa, Mikkosoft Productions
 Distributed under the LGPL
 */
 
-#include <sys/wait.h>
-#include <iostream>
 #include <cstring>
 #include <cstdlib>
+#include <sys/wait.h>
 #include <msp/fs/dir.h>
+#include <msp/io/print.h>
+#include <msp/strings/utils.h>
 #include "builder.h"
 #include "externalaction.h"
 
@@ -19,15 +20,7 @@ using namespace Msp;
 void ExternalAction::launch()
 {
        if(builder.get_verbose()>=2)
-       {
-               for(StringList::const_iterator i=argv.begin(); i!=argv.end(); ++i)
-               {
-                       if(i!=argv.begin())
-                               cout<<' ';
-                       cout<<*i;
-               }
-               cout<<'\n';
-       }
+               IO::print("%s\n", join(argv.begin(), argv.end()));
 
        if(builder.get_dry_run())
                pid=-1;
@@ -46,7 +39,7 @@ void ExternalAction::launch()
                        if(!work_dir.empty())
                                FS::chdir(work_dir);
                        execvp(argv_[0], argv_);
-                       cout<<"Couldn't execute "<<argv.front()<<'\n';
+                       IO::print("Couldn't execute %s\n", argv.front());
                        exit(1);
                }
                else if(pid<0)