lib: use dedicated BT_LOG*_ERRNO() instead of using strerror()
[babeltrace.git] / lib / ctf-ir / stream.c
index 1c3d534f30ed3c122112dd90188cc88c6c931863..f13c024a3f230628853a5730c826c113b2bc6834 100644 (file)
@@ -731,10 +731,9 @@ append_ids:
                S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP);
        g_free(file_path);
        if (fd < 0) {
-               BT_LOGW("Failed to open stream file for writing: %s: "
-                       "filename=\"%s\", "
-                       "ret=%d, errno=%d", strerror(errno),
-                       filename->str, fd, errno);
+               BT_LOGW_ERRNO("Failed to open stream file for writing",
+                       ": file_path=\"%s\", filename=\"%s\", ret=%d",
+                       file_path, filename->str, fd);
                goto end;
        }
 
@@ -1795,16 +1794,14 @@ void bt_ctf_stream_destroy(struct bt_object *obj)
                        ret = ftruncate(stream->pos.fd, stream->size);
                } while (ret == -1 && errno == EINTR);
                if (ret) {
-                       BT_LOGE("Failed to truncate stream file: %s: "
-                               "ret=%d, errno=%d, size=%" PRIu64,
-                               strerror(errno), ret, errno,
-                               (uint64_t) stream->size);
+                       BT_LOGE_ERRNO("Failed to truncate stream file",
+                               ": ret=%d, size=%" PRIu64,
+                               ret, (uint64_t) stream->size);
                }
 
                if (close(stream->pos.fd)) {
-                       BT_LOGE("Failed to close stream file: %s: "
-                               "ret=%d, errno=%d", strerror(errno),
-                               ret, errno);
+                       BT_LOGE_ERRNO("Failed to close stream file",
+                               ": ret=%d", ret);
                }
        }
 
This page took 0.023336 seconds and 4 git commands to generate.