summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorinfirit <[email protected]>2014-12-17 17:46:27 +0100
committerinfirit <[email protected]>2014-12-17 17:46:27 +0100
commit7e751f28f66efe19b4abe427e0e08842ac352573 (patch)
tree3088216ef2ff4164ad157b99d777d2629a2aad19 /src
parent2a0ef42d45004d7b0775ac843352cf10d11ce091 (diff)
downloadmate-system-monitor-7e751f28f66efe19b4abe427e0e08842ac352573.tar.bz2
mate-system-monitor-7e751f28f66efe19b4abe427e0e08842ac352573.tar.xz
Add OpenBSD support
Add OpenBSDSysInfo() for getting OpenBSD system information Taken from GSM commit: 8cc3d4d04963bc5f4e70fa6d81a8ad009eac9021 From: Antoine Jacoutot <[email protected]> Gnome bug: https://bugzilla.gnome.org/show_bug.cgi?id=652584
Diffstat (limited to 'src')
-rw-r--r--src/sysinfo.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/sysinfo.cpp b/src/sysinfo.cpp
index 82cdcf7..6e7ce54 100644
--- a/src/sysinfo.cpp
+++ b/src/sysinfo.cpp
@@ -420,6 +420,28 @@ namespace {
};
+ class OpenBSDSysInfo
+ : public SysInfo
+ {
+ public:
+ OpenBSDSysInfo()
+ {
+ this->load_openbsd_info();
+ }
+
+ private:
+ void load_openbsd_info()
+ {
+ this->distro_name = "OpenBSD";
+ this->distro_release = this->kernel;
+
+ std::ifstream input("/etc/motd");
+
+ if (input)
+ std::getline(input, this->kernel);
+ }
+ };
+
SysInfo* get_sysinfo()
{
if (g_file_test ("/etc/os-release", G_FILE_TEST_EXISTS)) {
@@ -435,6 +457,9 @@ namespace {
else if (SysInfo::system() == "NetBSD") {
return new NetBSDSysInfo;
}
+ else if (SysInfo::system() == "OpenBSD") {
+ return new OpenBSDSysInfo;
+ }
return new SysInfo;
}