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;
}
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);
}
}