projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use realpath for path
[babeltrace.git]
/
formats
/
ctf
/
ctf.c
diff --git
a/formats/ctf/ctf.c
b/formats/ctf/ctf.c
index 7839bb33574f3d0f4a5ac8a3c9dd0c4ec9711a99..0f216933b6c06c215e8fba048c23f03e7c24fd22 100644
(file)
--- a/
formats/ctf/ctf.c
+++ b/
formats/ctf/ctf.c
@@
-1239,7
+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;
struct dirent *dirent;
struct dirent *diriter;
size_t dirent_len;
- char *respath;
+ char *respath
, *rescolpath
;
td->flags = flags;
td->flags = flags;
@@
-1258,13
+1258,16
@@
int ctf_open_trace_read(struct ctf_trace *td, const char *collection_path,
ret = -errno;
goto error_dirfd;
}
ret = -errno;
goto error_dirfd;
}
- respath = realpath(collection_path, td->collection_path);
- if (!respath) {
+ 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 (!rescolpath) {
fprintf(stdout, "[error] path resolution failure\n");
return -EINVAL;
}
fprintf(stdout, "[error] path resolution failure\n");
return -EINVAL;
}
- strncpy(td->path, path, PATH_MAX);
- td->path[PATH_MAX - 1] = '\0';
init_domain_name(td);
init_proc_name(td);
init_vpid(td);
init_domain_name(td);
init_proc_name(td);
init_vpid(td);
This page took
0.022501 seconds
and
4
git commands to generate.