From d3ce4a87657205404e32f1b865b6c14a318de507 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Date: Fri, 16 Dec 2022 13:33:03 +0100 Subject: [PATCH] Store the process directory in proc->dir --- src/emu/trace.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/emu/trace.c b/src/emu/trace.c index 579c8c6..d590d2d 100644 --- a/src/emu/trace.c +++ b/src/emu/trace.c @@ -299,15 +299,16 @@ load_loom(struct ovni_loom *loom, char *loomdir) if (find_dir_prefix_int(dirent->d_name, "proc", &pid) != 0) continue; - char path[PATH_MAX]; - sprintf(path, "%s/%s", loomdir, dirent->d_name); - if (i >= loom->nprocs) { err("more process than expected\n"); abort(); } - if (load_proc(&loom->proc[i], loom, i, pid, path) != 0) + struct ovni_eproc *proc = &loom->proc[i]; + + sprintf(proc->dir, "%s/%s", loomdir, dirent->d_name); + + if (load_proc(&loom->proc[i], loom, i, pid, proc->dir) != 0) return -1; i++;