Commit 48d17cdb authored by Nishanth Menon's avatar Nishanth Menon

[COMMON][TRACE] Add debug print if chdir does not work

yet another gcc 5.2 nuisance. fixes:
common/trace.c: In function ‘trace_perf_capture’:
common/trace.c:1633:2: warning: ignoring return value of ‘chdir’, declared with attribute warn_unused_result [-Wunused-result]
  chdir("/data");
  ^
Reported-by: default avatarRobert C Nelson <robertcnelson@gmail.com>
Signed-off-by: default avatarNishanth Menon <nm@ti.com>
parent 06588afe
......@@ -1630,7 +1630,11 @@ int trace_perf_capture(const char *cfgfile, const char *prefix,
* Change the default working directory, the current one may not be
* writable. Use "/data" as known to be writable (or remountable).
*/
chdir("/data");
if (chdir("/data")) {
dprintf("%s: unable to chdir to /data, using curdir\n",
__func__);
/* ignore and continue in current directory */
}
#ifdef TRACE_DEBUG
cwd = getcwd(NULL, 0);
printf("%s(): current working directory is %s\n", __func__, cwd);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment