diff --git a/src/linux.cc b/src/linux.cc index ba5cf5dc..965f9909 100644 --- a/src/linux.cc +++ b/src/linux.cc @@ -2711,7 +2711,6 @@ static void update_process_table(void) } info.run_procs = 0; - ++g_time; /* Get list of processes from /proc directory */ while ((entry = readdir(dir))) { diff --git a/src/top.cc b/src/top.cc index 020d6a04..f38b232a 100644 --- a/src/top.cc +++ b/src/top.cc @@ -330,6 +330,12 @@ static void process_find_top(struct process **cpu, struct process **mem, pq_set_max_size(io_queue, MAX_SP); #endif + /* g_time is the time_stamp entry for process. It is updated when the + * process information is updated to indicate that the process is still + * alive (and must not be removed from the process list in + * process_cleanup()) */ + ++g_time; + /* OS-specific function updating process list */ get_top_info();