src.ctf.fs: append error causes in ctf_fs_file_open
[babeltrace.git] / src / plugins / ctf / fs-src / file.c
index 9c116782299c0d3c5fc4d2c15a4c8c28ee0bcc59..2191b67100a4cdb6a3e7ce4af3e8fe8dacb2058e 100644 (file)
@@ -93,15 +93,18 @@ int ctf_fs_file_open(struct ctf_fs_file *file, const char *mode)
        BT_COMP_LOGI("Opening file \"%s\" with mode \"%s\"", file->path->str, mode);
        file->fp = fopen(file->path->str, mode);
        if (!file->fp) {
-               BT_COMP_LOGE("Cannot open file \"%s\" with mode \"%s\": %s",
-                       file->path->str, mode, strerror(errno));
+               BT_COMP_LOGE_APPEND_CAUSE_ERRNO(file->self_comp,
+                       "Cannot open file", ": path=%s, mode=%s",
+                       file->path->str, mode);
                goto error;
        }
 
        BT_COMP_LOGI("Opened file: %p", file->fp);
 
        if (fstat(fileno(file->fp), &stat)) {
-               BT_COMP_LOGE("Cannot get file information: %s", strerror(errno));
+               BT_COMP_LOGE_APPEND_CAUSE_ERRNO(file->self_comp,
+                       "Cannot get file information",
+                       ": path=%s", file->path->str);
                goto error;
        }
 
This page took 0.024434 seconds and 4 git commands to generate.