summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2009-05-26 21:27:06 +0000
committerAndrew Stitcher <astitcher@apache.org>2009-05-26 21:27:06 +0000
commit5ce2eb3ccdfe0b90436b6095b0498d59f9057de0 (patch)
treeda91d8727282329ab846e85571575207cbab656b /cpp
parentd41c4461932cd44629314fa11c8435764c31a6e3 (diff)
downloadqpid-python-5ce2eb3ccdfe0b90436b6095b0498d59f9057de0.tar.gz
[Linux] Small tidy up of SystemInfo code to get executable name
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@778892 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp')
-rwxr-xr-xcpp/src/qpid/sys/posix/SystemInfo.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/cpp/src/qpid/sys/posix/SystemInfo.cpp b/cpp/src/qpid/sys/posix/SystemInfo.cpp
index 5d9eda605d..db3b48e6fe 100755
--- a/cpp/src/qpid/sys/posix/SystemInfo.cpp
+++ b/cpp/src/qpid/sys/posix/SystemInfo.cpp
@@ -107,14 +107,12 @@ uint32_t SystemInfo::getParentProcessId()
return (uint32_t) ::getppid();
}
+// Linux specific (Solaris has quite different stuff in /proc)
string SystemInfo::getProcessName()
{
- uint32_t pid = getProcessId();
string value;
- stringstream pathStream;
- pathStream << "/proc/" << pid << "/status";
- ifstream input(pathStream.str().c_str());
+ ifstream input("/proc/self/status");
if (input.good()) {
while (!input.eof()) {
string key;