*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License Version 2 as
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License Version 2 as
- 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);
g_ptr_array_add(proc->process_files_table, file);
} else {
tmp_file = g_ptr_array_index(proc->process_files_table, fd);
tmp = get_proc(ctx, tid, comm, timestamp);
tmp = get_proc(ctx, tid, comm, timestamp);
- tmp = get_proc_pid(<tngtop, tid, pid, timestamp);
+ tmp = get_proc(<tngtop, tid, procname, timestamp);
+ if (!tmp)
+ goto end;
+
tmp->syscall_info = create_syscall_info(__NR_write, cpu_id, tid, fd);
insert_file(tmp, fd);
tmp->syscall_info = create_syscall_info(__NR_write, cpu_id, tid, fd);
insert_file(tmp, fd);
- tmp = get_proc_pid(<tngtop, tid, pid, timestamp);
+ tmp = get_proc(<tngtop, tid, procname, timestamp);
+ if (!tmp)
+ goto end;
+
tmp->syscall_info = create_syscall_info(__NR_read, cpu_id, tid, fd);
insert_file(tmp, fd);
tmp->syscall_info = create_syscall_info(__NR_read, cpu_id, tid, fd);
insert_file(tmp, fd);
- tmp = get_proc_pid(<tngtop, tid, pid, timestamp);
+ tmp = get_proc(<tngtop, tid, procname, timestamp);
+ if (!tmp)
+ goto end;
+
tmp->syscall_info = create_syscall_info(__NR_open, cpu_id, tid, -1);
tmp->files_history = create_file(tmp->files_history, file);
tmp->syscall_info = create_syscall_info(__NR_open, cpu_id, tid, -1);
tmp->files_history = create_file(tmp->files_history, file);
- tmp = get_proc_pid(<tngtop, tid, pid, timestamp);
+ tmp = get_proc(<tngtop, tid, procname, timestamp);
+ if (!tmp)
+ goto end;
}
parent = get_proc_pid(<tngtop, pid, pid, timestamp);
}
parent = get_proc_pid(<tngtop, pid, pid, timestamp);
parent->files_history = create_file(parent->files_history, file_name);
file = parent->files_history->file;
edit_file(parent, file, fd);
parent->files_history = create_file(parent->files_history, file_name);
file = parent->files_history->file;
edit_file(parent, file, fd);