blob: bfb088676904cca9ca1ce4d47c4bca4ea795a9d6 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
--- src/sysinfo.cpp.orig Tue Feb 27 01:52:44 2007
+++ src/sysinfo.cpp Wed Feb 28 00:17:06 2007
@@ -14,11 +14,13 @@
#include <sys/wait.h>
#include <math.h>
#include <errno.h>
-
#include <string>
#include <vector>
#include <fstream>
#include <sstream>
+#ifdef __FreeBSD__
+#include <sys/utsname.h>
+#endif
#include "sysinfo.h"
#include "util.h"
@@ -243,6 +245,30 @@ namespace {
}
};
+#ifdef __FreeBSD__
+ class UnameSysInfo
+ : public SysInfo
+ {
+ public:
+ UnameSysInfo()
+ {
+ this->load_uname_info();
+ }
+
+ private:
+
+ void load_uname_info()
+ {
+ struct utsname name;
+
+ uname(&name);
+
+ this->distro_name = name.sysname;
+ this->distro_release = name.release;
+ this->distro_codename = name.machine;
+ }
+ };
+#endif
SysInfo* get_sysinfo()
{
@@ -250,9 +276,12 @@ namespace {
g_free(p);
return new LSBSysInfo;
}
+#ifdef __FreeBSD__
+ return new UnameSysInfo;
+#else
else if (g_file_test("/etc/release", G_FILE_TEST_EXISTS))
return new SolarisSysInfo;
-
+#endif
return new SysInfo(_("Unknown distribution"));
}
}
|