diff options
Diffstat (limited to 'src/Common/Backends/SystemBackendPosix.h')
-rw-r--r-- | src/Common/Backends/SystemBackendPosix.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/Common/Backends/SystemBackendPosix.h b/src/Common/Backends/SystemBackendPosix.h index 4a2c572..b7f364a 100644 --- a/src/Common/Backends/SystemBackendPosix.h +++ b/src/Common/Backends/SystemBackendPosix.h @@ -38,16 +38,24 @@ class SystemBackendPosix : public SystemBackend { private: static SystemBackendPosix backend; static std::map<pid_t, sigc::slot<void, int> > processes; + static std::map<pid_t, std::pair<sigc::slot<void, int, const std::string&>, int> > processesWithOutput; static void setChildHandler(); static void childHandler(int); + static std::pair<char**, char**> makeArgs(const std::string &filename, const std::vector<std::string> &argv, const std::vector<std::string> &env); + static void destroyArgs(std::pair<char**, char**> args); + SystemBackendPosix() { setChildHandler(); } + void fsInfoCallback(int, const std::string &output, const sigc::slot<void, const std::vector<FSInfo>& > &callback); + protected: + virtual bool fsInfo(const sigc::slot<void, const std::vector<FSInfo>& > &callback); + virtual bool doShutdown(const sigc::slot<void> &callback) {return exec(sigc::hide(callback), "/sbin/halt");} virtual bool doReboot(const sigc::slot<void> &callback) {return exec(sigc::hide(callback), "/sbin/reboot");} @@ -64,6 +72,9 @@ class SystemBackendPosix : public SystemBackend { static bool exec(const sigc::slot<void, int> &resultHandler, const std::string &filename, const std::vector<std::string> &argv = std::vector<std::string>(), const std::vector<std::string> &env = std::vector<std::string>()); + + static bool execWithOutput(const sigc::slot<void, int, const std::string&> &resultHandler, const std::string &filename, const std::vector<std::string> &argv = std::vector<std::string>(), + const std::vector<std::string> &env = std::vector<std::string>()); }; } |