build as lib - work in progress

This commit is contained in:
Mohamed Boussaffa
2016-03-04 00:09:51 +08:00
parent 0b4ba231c0
commit 730a5c2624
3 changed files with 6 additions and 4 deletions

View File

@@ -81,7 +81,6 @@ void NethogsMonitor::threadProc()
fprintf(stderr, "Waiting for first packet to arrive (see sourceforge.net bug 1019381)\n");
struct dpargs * userdata = (dpargs *) malloc (sizeof (struct dpargs));
time_t last_event_time = 0;
// Main loop:
// Walks though the 'handles' list, which contains handles opened in non-blocking mode.
// This causes the CPU utilisation to go up to 100%. This is tricky:
@@ -110,7 +109,6 @@ void NethogsMonitor::threadProc()
if ( packets_read && needrefresh )
{
needrefresh = false;
last_event_time = dp_get_lasttime();
handleUpdate();
}
@@ -149,6 +147,9 @@ void NethogsMonitor::handleUpdate()
{
if (DEBUG)
std::cout << "PROC: Deleting process\n";
monitor_data.apps_info.erase(curproc->getVal()->name);
ProcList * todelete = curproc;
Process * p_todelete = curproc->getVal();
if (previousproc)