make inode field 'const' and private
This commit is contained in:
@@ -276,7 +276,7 @@ Process * getProcess (Connection * connection, const char * devicename)
|
|||||||
proc = getProcess(inode, devicename);
|
proc = getProcess(inode, devicename);
|
||||||
|
|
||||||
if (proc == NULL) {
|
if (proc == NULL) {
|
||||||
proc = new Process (0, "", connection->refpacket->gethashstring());
|
proc = new Process (inode, "", connection->refpacket->gethashstring());
|
||||||
processes = new ProcList (proc, processes);
|
processes = new ProcList (proc, processes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
11
process.h
11
process.h
@@ -66,12 +66,12 @@ class Process
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/* the process makes a copy of the name. the device name needs to be stable. */
|
/* 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;
|
//std::cout << "ARN: Process created with dev " << m_devicename << std::endl;
|
||||||
if (DEBUG)
|
if (DEBUG)
|
||||||
std::cout << "PROC: Process created at " << this << std::endl;
|
std::cout << "PROC: Process created at " << this << std::endl;
|
||||||
inode = m_inode;
|
|
||||||
|
|
||||||
if (m_name == NULL)
|
if (m_name == NULL)
|
||||||
name = NULL;
|
name = NULL;
|
||||||
@@ -99,7 +99,6 @@ public:
|
|||||||
const char * devicename;
|
const char * devicename;
|
||||||
int pid;
|
int pid;
|
||||||
|
|
||||||
unsigned long inode;
|
|
||||||
ConnList * connections;
|
ConnList * connections;
|
||||||
uid_t getUid()
|
uid_t getUid()
|
||||||
{
|
{
|
||||||
@@ -110,7 +109,13 @@ public:
|
|||||||
{
|
{
|
||||||
uid = m_uid;
|
uid = m_uid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned long getInode()
|
||||||
|
{
|
||||||
|
return inode;
|
||||||
|
}
|
||||||
private:
|
private:
|
||||||
|
const unsigned long inode;
|
||||||
uid_t uid;
|
uid_t uid;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user