/* * This procedure removes all dead procs/user/.. from the specified list. */ static void list_refresh_id(list_t *list) { id_info_t *id, *id_next; if (!(list->l_type & LT_PROCESS) && !(list->l_type & LT_USERS) && !(list->l_type & LT_TASKS) && !(list->l_type & LT_PROJECTS) && !(list->l_type & LT_PSETS)) { return; } id = list->l_head; while (id) { if (id->id_alive == B_FALSE) { /* id is dead */ id_next = id->id_next; list_remove_id(list, id); id = id_next; } else { /* normalize total mem and cpu across all processes. */ if (total_mem >= 100) id->id_pctmem = (100 * id->id_pctmem) / total_mem; if (total_cpu >= 100) id->id_pctcpu = (100 * id->id_pctcpu) / total_cpu; id->id_alive = B_FALSE; id = id->id_next; } } }
void remove_job (int i) { list_remove_id ((sdlist **)&list, i, (free_c)free_command); }