diff options
Diffstat (limited to 'src/modules/SystemBackendPosix/SystemBackendPosix.cpp')
-rw-r--r-- | src/modules/SystemBackendPosix/SystemBackendPosix.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/modules/SystemBackendPosix/SystemBackendPosix.cpp b/src/modules/SystemBackendPosix/SystemBackendPosix.cpp index a215c86..35e6c4f 100644 --- a/src/modules/SystemBackendPosix/SystemBackendPosix.cpp +++ b/src/modules/SystemBackendPosix/SystemBackendPosix.cpp @@ -29,12 +29,12 @@ namespace Modules { boost::shared_ptr<SystemBackendPosix> SystemBackendPosix::backend; -bool SystemBackendPosix::getFSInfo(std::vector<Common::SystemManager::FSInfo> *fsInfo) { +void SystemBackendPosix::getFSInfo(std::vector<Common::SystemManager::FSInfo> *fsInfo) throw(Net::Exception) { Net::ThreadManager::get()->detach(); FILE *pipe = popen("/bin/df -P -k", "r"); if(!pipe) - return false; + throw(Net::Exception(Net::Exception::NOT_AVAILABLE)); char buffer[1024]; std::string output; @@ -47,7 +47,7 @@ bool SystemBackendPosix::getFSInfo(std::vector<Common::SystemManager::FSInfo> *f pclose(pipe); if(!fsInfo) - return true; + return; fsInfo->clear(); @@ -75,19 +75,21 @@ bool SystemBackendPosix::getFSInfo(std::vector<Common::SystemManager::FSInfo> *f delete [] mountedOn; } - return true; + return; } -bool SystemBackendPosix::shutdown() { +void SystemBackendPosix::shutdown() throw(Net::Exception) { Net::ThreadManager::get()->detach(); - return (system("/sbin/halt") == 0); + if(system("/sbin/halt") != 0) + throw(Net::Exception(Net::Exception::NOT_AVAILABLE)); } -bool SystemBackendPosix::reboot() { +void SystemBackendPosix::reboot() throw(Net::Exception) { Net::ThreadManager::get()->detach(); - return (system("/sbin/reboot") == 0); + if(system("/sbin/reboot") != 0) + throw(Net::Exception(Net::Exception::NOT_AVAILABLE)); } } |