From 0ac3e624fca0f333f2c3b2221cfcc6d9f6747920 Mon Sep 17 00:00:00 2001 From: Arnout Engelen Date: Fri, 16 Mar 2012 00:07:33 +0000 Subject: [PATCH] make inode field 'const' and private --- process.cpp | 2 +- process.h | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/process.cpp b/process.cpp index a917e95..aa071d5 100644 --- a/process.cpp +++ b/process.cpp @@ -276,7 +276,7 @@ Process * getProcess (Connection * connection, const char * devicename) proc = getProcess(inode, devicename); if (proc == NULL) { - proc = new Process (0, "", connection->refpacket->gethashstring()); + proc = new Process (inode, "", connection->refpacket->gethashstring()); processes = new ProcList (proc, processes); } diff --git a/process.h b/process.h index d33db42..d326d29 100644 --- a/process.h +++ b/process.h @@ -66,12 +66,12 @@ class Process { public: /* the process makes a copy of the name. the device name needs to be stable. */ - Process (unsigned long m_inode, const char * m_devicename, const char * m_name = NULL) + Process (const unsigned long m_inode, const char * m_devicename, const char * m_name = NULL) + : inode (m_inode) { //std::cout << "ARN: Process created with dev " << m_devicename << std::endl; if (DEBUG) std::cout << "PROC: Process created at " << this << std::endl; - inode = m_inode; if (m_name == NULL) name = NULL; @@ -99,7 +99,6 @@ public: const char * devicename; int pid; - unsigned long inode; ConnList * connections; uid_t getUid() { @@ -110,7 +109,13 @@ public: { uid = m_uid; } + + unsigned long getInode() + { + return inode; + } private: + const unsigned long inode; uid_t uid; };