Fix display process in a timeframe before its creation
authorJulien Desfossez <julien.desfossez@efficios.com>
Mon, 16 Apr 2012 18:54:38 +0000 (14:54 -0400)
committerJulien Desfossez <julien.desfossez@efficios.com>
Mon, 16 Apr 2012 18:54:38 +0000 (14:54 -0400)
Signed-off-by: Julien Desfossez <julien.desfossez@efficios.com>
src/cursesdisplay.c

index 16e378b40cdcce0d1c911b95819754d5501ab3ae..af09cb2df1280a7bb1292d988ad052ca83998c84 100644 (file)
@@ -490,9 +490,7 @@ void update_process_details()
 {
        unsigned long elapsed;
        double maxcputime;
-       struct processtop *tmp = find_process_tid(data,
-                       selected_process->tid,
-                       selected_process->comm);
+       struct processtop *tmp;
        struct files *file_tmp;
        int i, j = 0;
        char unit[4];
@@ -500,13 +498,16 @@ void update_process_details()
        set_window_title(center, "Process details");
 
 
+       tmp = find_process_tid(data,
+                       selected_process->tid,
+                       selected_process->comm);
        elapsed = data->end - data->start;
        maxcputime = elapsed * data->cpu_table->len / 100.0;
 
        print_key_title("Name", 1);
-       wprintw(center, "%s", tmp->comm);
+       wprintw(center, "%s", selected_process->comm);
        print_key_title("TID", 2);
-       wprintw(center, "%d", tmp->tid);
+       wprintw(center, "%d", selected_process->tid);
        if (!tmp) {
                print_key_title("Does not exit at this time", 3);
                return;
This page took 0.023991 seconds and 4 git commands to generate.