X-Git-Url: https://git.lttng.org/?p=lttngtop.git;a=blobdiff_plain;f=src%2Fiostreamtop.c;fp=src%2Fiostreamtop.c;h=baccb65cab799bd2857047ff7cf1fac668f248ef;hp=33b901938b9356e65690694c297f403483edd84b;hb=32647247b1922e0aee8ffed0272d356486ee103a;hpb=89f1e0d139842127e678b90394cbf5ccb1b5ea44 diff --git a/src/iostreamtop.c b/src/iostreamtop.c index 33b9019..baccb65 100644 --- a/src/iostreamtop.c +++ b/src/iostreamtop.c @@ -31,13 +31,17 @@ void add_file(struct processtop *proc, struct files *file, int fd) struct files *tmp_file; struct processtop *parent; int size; + int i; size = proc->process_files_table->len; parent = proc->threadparent; if (parent) insert_file(parent, fd); if (size <= fd) { - g_ptr_array_set_size(proc->process_files_table, fd); + /* Add NULL file structures for undefined FDs */ + for (i = size; i < fd; i++) { + g_ptr_array_add(proc->process_files_table, NULL); + } g_ptr_array_add(proc->process_files_table, file); } else { tmp_file = g_ptr_array_index(proc->process_files_table, fd);