qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From astitc...@apache.org
Subject svn commit: r778892 - /qpid/trunk/qpid/cpp/src/qpid/sys/posix/SystemInfo.cpp
Date Tue, 26 May 2009 21:27:06 GMT
Author: astitcher
Date: Tue May 26 21:27:06 2009
New Revision: 778892

URL: http://svn.apache.org/viewvc?rev=778892&view=rev
Log:
[Linux] Small tidy up of SystemInfo code to get executable name

Modified:
    qpid/trunk/qpid/cpp/src/qpid/sys/posix/SystemInfo.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/sys/posix/SystemInfo.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/sys/posix/SystemInfo.cpp?rev=778892&r1=778891&r2=778892&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/sys/posix/SystemInfo.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/sys/posix/SystemInfo.cpp Tue May 26 21:27:06 2009
@@ -107,14 +107,12 @@
     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;



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message