summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/broker/System.cpp
diff options
context:
space:
mode:
authorStephen D. Huston <shuston@apache.org>2008-10-09 15:20:49 +0000
committerStephen D. Huston <shuston@apache.org>2008-10-09 15:20:49 +0000
commit0b195851725cd2b0982d26a108e7239eca6b2052 (patch)
tree0eeaa66dc3daa0147c92995cda6b0f014ac8c512 /cpp/src/qpid/broker/System.cpp
parentbfa255f4fd7a67f1433b424913515633d7e58c2f (diff)
downloadqpid-python-0b195851725cd2b0982d26a108e7239eca6b2052.tar.gz
Make Address/TcpAddress manipulation portable; extend SystemInfo functions to Windows; resolves QPID-1325
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@703179 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/System.cpp')
-rw-r--r--cpp/src/qpid/broker/System.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/cpp/src/qpid/broker/System.cpp b/cpp/src/qpid/broker/System.cpp
index 7b5e843e90..a11ad25bbe 100644
--- a/cpp/src/qpid/broker/System.cpp
+++ b/cpp/src/qpid/broker/System.cpp
@@ -20,7 +20,7 @@
#include "System.h"
#include "qpid/agent/ManagementAgent.h"
#include "qpid/framing/Uuid.h"
-#include <sys/utsname.h>
+#include "qpid/sys/SystemInfo.h"
#include <iostream>
#include <fstream>
@@ -64,15 +64,17 @@ System::System (string _dataDir) : mgmtObject(0)
}
mgmtObject = new _qmf::System (agent, this, systemId);
- struct utsname _uname;
- if (uname (&_uname) == 0)
- {
- mgmtObject->set_osName (std::string (_uname.sysname));
- mgmtObject->set_nodeName (std::string (_uname.nodename));
- mgmtObject->set_release (std::string (_uname.release));
- mgmtObject->set_version (std::string (_uname.version));
- mgmtObject->set_machine (std::string (_uname.machine));
- }
+ std::string sysname, nodename, release, version, machine;
+ qpid::sys::SystemInfo::getSystemId (sysname,
+ nodename,
+ release,
+ version,
+ machine);
+ mgmtObject->set_osName (sysname);
+ mgmtObject->set_nodeName (nodename);
+ mgmtObject->set_release (release);
+ mgmtObject->set_version (version);
+ mgmtObject->set_machine (machine);
agent->addObject (mgmtObject, 0x1000000000000001LL);
}