Fix parallel build for lib/
[babeltrace.git] / formats / ctf / ctf.c
index 20f2dae0bd6efe28c2ca3b70da43ba0929f9063f..752213ec1d74cc26ef1866b08b2f36646c256b3f 100644 (file)
@@ -1239,6 +1239,7 @@ int ctf_open_trace_read(struct ctf_trace *td, const char *collection_path,
        struct dirent *dirent;
        struct dirent *diriter;
        size_t dirent_len;
+       char *respath, *rescolpath;
 
        td->flags = flags;
 
@@ -1257,10 +1258,16 @@ int ctf_open_trace_read(struct ctf_trace *td, const char *collection_path,
                ret = -errno;
                goto error_dirfd;
        }
-       strncpy(td->collection_path, collection_path, PATH_MAX);
-       td->collection_path[PATH_MAX - 1] = '\0';
-       strncpy(td->path, path, PATH_MAX);
-       td->path[PATH_MAX - 1] = '\0';
+       rescolpath = realpath(collection_path, td->collection_path);
+       if (!rescolpath) {
+               fprintf(stdout, "[error] collection path resolution failure\n");
+               return -EINVAL;
+       }
+       respath = realpath(path, td->path);
+       if (!respath) {
+               fprintf(stdout, "[error] path resolution failure\n");
+               return -EINVAL;
+       }
        init_domain_name(td);
        init_proc_name(td);
        init_vpid(td);
This page took 0.025662 seconds and 4 git commands to generate.