From 5ce2eb3ccdfe0b90436b6095b0498d59f9057de0 Mon Sep 17 00:00:00 2001 From: Andrew Stitcher Date: Tue, 26 May 2009 21:27:06 +0000 Subject: [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 --- cpp/src/qpid/sys/posix/SystemInfo.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'cpp/src') 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; -- cgit v1.2.1