diff --git a/core/file.c b/core/file.c index 3b122868..38464fbb 100644 --- a/core/file.c +++ b/core/file.c @@ -13,8 +13,8 @@ const gchar *OCARINA_DIR = "ocarina-debug"; const gchar *OCARINA_DIR = "ocarina"; #endif -#define REPORT_ERROR() \ - printf("%s (%s:%d): %s\n", __func__, __FILE__, __LINE__, strerror(errno)) +#define REPORT_ERROR(fname) \ + printf("%s (%s:%d): %s: %s\n", __func__, __FILE__, __LINE__, fname, strerror(errno)) static gchar *__file_path(gchar *name) @@ -29,7 +29,7 @@ static bool __file_mkdir() g_free(dir); if (ret != 0) - REPORT_ERROR(); + REPORT_ERROR(dir); return ret == 0; } @@ -73,7 +73,7 @@ static bool __file_open_common(struct file *file, enum open_mode mode) g_free(path); if (!file->f_file) { - REPORT_ERROR(); + REPORT_ERROR(file->f_name); return false; } @@ -149,6 +149,6 @@ int file_writef(struct file *file, const char *fmt, ...) va_end(argp); if (ret < 0) - REPORT_ERROR(); + REPORT_ERROR(file->f_name); return ret; }