From aaef16fb6fce63936bc0fd7aca205b7f1b0c9580 Mon Sep 17 00:00:00 2001 From: Zdenek Prikryl Date: Thu, 12 Feb 2009 11:50:56 +0100 Subject: for getting proc info and package names there are separate plublic methods --- lib/Utils/DebugDump.cpp | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to 'lib/Utils/DebugDump.cpp') diff --git a/lib/Utils/DebugDump.cpp b/lib/Utils/DebugDump.cpp index e0f88c4c..09e65aea 100644 --- a/lib/Utils/DebugDump.cpp +++ b/lib/Utils/DebugDump.cpp @@ -79,13 +79,6 @@ void CDebugDump::Create(const std::string& pDir) SaveTime(); } -void CDebugDump::Create(const std::string& pDir, const std::string& pPID) -{ - Create(pDir); - SaveProc(pPID); -} - - void CDebugDump::Delete(const std::string& pDir) { if (!ExistFileDir(pDir)) @@ -253,12 +246,6 @@ void CDebugDump::SaveProc(const std::string& pPID) SaveText(FILENAME_EXECUTABLE, executable); } - CPackages packages; - while (!packages.SearchFile(executable)) {} - while (!packages.GetStatus()) {} - std::string package = packages.GetSearchFileReply(); - - SaveText(FILENAME_PACKAGE, package); path = "/proc/"+pPID+"/status"; std::string uid = ""; @@ -273,4 +260,21 @@ void CDebugDump::SaveProc(const std::string& pPID) ii++; } SaveText(FILENAME_UID, uid); + + path = "/proc/"+pPID+"/cmdline"; + LoadTextFile(path, data); + SaveText(FILENAME_CMDLINE, data); +} + +void CDebugDump::SavePackage() +{ + std::string executable; + std::string package = ""; + if (Exist(FILENAME_EXECUTABLE)) + { + CPackages packages; + LoadText(FILENAME_EXECUTABLE, executable); + package = packages.SearchFile("/usr/sbin/acpid"); + } + SaveText(FILENAME_PACKAGE, package); } -- cgit