diff --git a/MakeLib.mk b/MakeLib.mk index 6a19b9a..c077fe5 100644 --- a/MakeLib.mk +++ b/MakeLib.mk @@ -23,7 +23,7 @@ else # Release mode options ODIR:=$(ODIR_BASE)/release CFLAGS?=-Wall -Wextra -O3 -fPIC $(VISIBILITY) - CXXFLAGS?=---std=c++11 Wall -Wextra -O3 -fPIC $(VISIBILITY) $(CXXINCLUDES) + CXXFLAGS?=-Wall --std=c++11 -Wextra -O3 -fPIC $(VISIBILITY) $(CXXINCLUDES) endif OBJ_NAMES= libnethogs.o packet.o connection.o process.o refresh.o decpcap.o inode2prog.o conninode.o devices.o diff --git a/libnethogs.cpp b/libnethogs.cpp index cbdba1b..b6125df 100644 --- a/libnethogs.cpp +++ b/libnethogs.cpp @@ -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) diff --git a/libnethogs.h b/libnethogs.h index 7f16e3a..cb92f1b 100644 --- a/libnethogs.h +++ b/libnethogs.h @@ -22,7 +22,8 @@ class NETHOGS_DSO_VISIBLE NethogsMonitorData float sent_kbs; float recv_kbs; }; - std::map apps_info; + typedef std::map TAppMap; + TAppMap apps_info; }; class NETHOGS_DSO_VISIBLE NethogsMonitor