]> git.tdb.fi Git - libs/core.git/blobdiff - source/core/process.cpp
Add move semantics to Variant
[libs/core.git] / source / core / process.cpp
index dfbea341310d19a039e4924ee122c1c0fd054f9d..4c5ed4651164615fc67b1d8a7c7523856876a233 100644 (file)
@@ -1,4 +1,5 @@
 #include <msp/io/console.h>
+#include "except.h"
 #include "process.h"
 #include "process_private.h"
 
@@ -6,30 +7,15 @@ using namespace std;
 
 namespace Msp {
 
-Process *Process::_self = 0;
+Process *Process::_self = nullptr;
 
 Process::Process(const Private &p):
        priv(new Private(p))
-{
-       init();
-}
+{ }
 
 Process::Process():
        priv(new Private)
-{
-       init();
-}
-
-void Process::init()
-{
-       redirect = false;
-       cin = 0;
-       cout = 0;
-       cerr = 0;
-       running = false;
-       finished = false;
-       exit_code = 0;
-}
+{ }
 
 Process &Process::self()
 {
@@ -93,7 +79,7 @@ void Process::execute(const FS::Path &command, const Arguments &args)
 unsigned Process::get_exit_code() const
 {
        if(!finished)
-               throw logic_error("not finished");
+               throw invalid_state("not finished");
        return exit_code;
 }