diff options
author | Andrew Stitcher <astitcher@apache.org> | 2009-05-26 21:27:06 +0000 |
---|---|---|
committer | Andrew Stitcher <astitcher@apache.org> | 2009-05-26 21:27:06 +0000 |
commit | e6e47a46b03da1a275cf6646614139f5d9abf513 (patch) | |
tree | ee7a048572129a6698b226dfdf63761ce04b4294 /qpid/cpp/src | |
parent | 20d3a8139c44dbd792a0974cfaf6fcc29d808b77 (diff) | |
download | qpid-python-e6e47a46b03da1a275cf6646614139f5d9abf513.tar.gz |
[Linux] Small tidy up of SystemInfo code to get executable name
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@778892 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src')
-rwxr-xr-x | qpid/cpp/src/qpid/sys/posix/SystemInfo.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/qpid/cpp/src/qpid/sys/posix/SystemInfo.cpp b/qpid/cpp/src/qpid/sys/posix/SystemInfo.cpp index 5d9eda605d..db3b48e6fe 100755 --- a/qpid/cpp/src/qpid/sys/posix/SystemInfo.cpp +++ b/qpid/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; |