diff options
Diffstat (limited to 'utils/filename.c')
-rw-r--r-- | utils/filename.c | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/utils/filename.c b/utils/filename.c index 9c95901a1..01a403fd9 100644 --- a/utils/filename.c +++ b/utils/filename.c @@ -84,7 +84,8 @@ const char *filename_request(void) /* no available slots - create a new directory */ dir = filename_create_directory(NULL); if (dir == NULL) { - LOG("Failed to create a new directory."); + NSLOG(netsurf, INFO, + "Failed to create a new directory."); return NULL; } i = 63; @@ -182,10 +183,12 @@ bool filename_initialise(void) for (start = directory; *start != '\0'; start++) { if (*start == '/') { *start = '\0'; - LOG("Creating \"%s\"", directory); + NSLOG(netsurf, INFO, "Creating \"%s\"", directory); ret = nsmkdir(directory, S_IRWXU); if (ret != 0 && errno != EEXIST) { - LOG("Failed to create directory \"%s\"", directory); + NSLOG(netsurf, INFO, + "Failed to create directory \"%s\"", + directory); free(directory); return false; } @@ -194,7 +197,7 @@ bool filename_initialise(void) } } - LOG("Temporary directory location: %s", directory); + NSLOG(netsurf, INFO, "Temporary directory location: %s", directory); ret = nsmkdir(directory, S_IRWXU); free(directory); @@ -280,7 +283,8 @@ bool filename_flush_directory(const char *folder, int depth) child[sizeof(child) - 1] = '\0'; if (stat(child, &statbuf) == -1) { - LOG("Unable to stat %s: %s", child, strerror(errno)); + NSLOG(netsurf, INFO, "Unable to stat %s: %s", child, + strerror(errno)); continue; } @@ -348,7 +352,8 @@ bool filename_flush_directory(const char *folder, int depth) filename_delete_recursive(child); if (remove(child)) - LOG("Failed to remove '%s'", child); + NSLOG(netsurf, INFO, "Failed to remove '%s'", + child); else changed = true; } else { @@ -387,7 +392,8 @@ bool filename_delete_recursive(char *folder) child[sizeof(child) - 1] = '\0'; if (stat(child, &statbuf) == -1) { - LOG("Unable to stat %s: %s", child, strerror(errno)); + NSLOG(netsurf, INFO, "Unable to stat %s: %s", child, + strerror(errno)); continue; } @@ -399,7 +405,7 @@ bool filename_delete_recursive(char *folder) } if (remove(child)) { - LOG("Failed to remove '%s'", child); + NSLOG(netsurf, INFO, "Failed to remove '%s'", child); closedir(parent); return false; } @@ -465,7 +471,7 @@ static struct directory *filename_create_directory(const char *prefix) /* allocate a new directory */ new_dir = malloc(sizeof(struct directory)); if (new_dir == NULL) { - LOG("No memory for malloc()"); + NSLOG(netsurf, INFO, "No memory for malloc()"); return NULL; } @@ -499,7 +505,9 @@ static struct directory *filename_create_directory(const char *prefix) * whilst we are running if there is an error, so we * don't report this yet and try to create the * structure normally. */ - LOG("Failed to create optimised structure '%s'", filename_directory); + NSLOG(netsurf, INFO, + "Failed to create optimised structure '%s'", + filename_directory); } } @@ -519,7 +527,9 @@ static struct directory *filename_create_directory(const char *prefix) if (!is_dir(filename_directory)) { if (nsmkdir(filename_directory, S_IRWXU)) { - LOG("Failed to create directory '%s'", filename_directory); + NSLOG(netsurf, INFO, + "Failed to create directory '%s'", + filename_directory); return NULL; } } |