diff --git a/src/files.c b/src/files.c index 5c2176a..0240164 100644 --- a/src/files.c +++ b/src/files.c @@ -54,6 +54,9 @@ HiResult file_copy(const char *srcname, const char *destination) { goto cleanup; } + // BUG: Maybe. Sometimes the copied file is 0 bytes with no clear errors. + // Maybe bytes_read ends up being 0 without it being an error condition, + // so ferror doesn't get flagged. char buffer[HI_FILE_BUFFER_SIZE]; size_t bytes_read = 0; while ((bytes_read = fread(buffer, 1, sizeof buffer, src)) > 0) { @@ -64,7 +67,7 @@ HiResult file_copy(const char *srcname, const char *destination) { } if (ferror(src)) { - log_error("Error reading from source: %s\n"); + log_error("Error reading from source: %s\n", strerror(errno)); goto cleanup; } diff --git a/src/hiload.c b/src/hiload.c index e7bef7e..752bb2e 100644 --- a/src/hiload.c +++ b/src/hiload.c @@ -215,8 +215,8 @@ int hi_init(size_t n, const char **enabled_modules) { fprintf(stderr, "Failed to init logger.\n"); return 1; } - log_set_level("DEBUG"); - log_set_thread_name("Main"); + log_set_level("WARNING"); + log_set_thread_name("Hiload"); // Start the filewatcher context.filewatcher = filewatcher_create();