From 5e64d1c4b78c908e92a65e03fdc6817ffe59a8a6 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Thu, 8 Sep 2022 09:04:24 +0200 Subject: log: refactoring --- src/file.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/file.c') diff --git a/src/file.c b/src/file.c index 3723cf6..58d63e3 100644 --- a/src/file.c +++ b/src/file.c @@ -16,7 +16,7 @@ static int unlink_cb(const char *fpath, UNUSED const struct stat *sb, UNUSED int ret = remove(fpath); if (ret < 0) { - print_errno("remove"); + log_errno("remove"); return ret; } @@ -25,7 +25,7 @@ static int unlink_cb(const char *fpath, UNUSED const struct stat *sb, UNUSED int int rm_rf(const char *dir) { - print_log("Recursively removing directory: %s\n", dir); + log("Recursively removing directory: %s\n", dir); return nftw(dir, unlink_cb, 64, FTW_DEPTH | FTW_PHYS); } @@ -36,14 +36,14 @@ int my_chdir(const char *dir, char **old) if (old) { *old = get_current_dir_name(); if (!*old) { - print_errno("get_current_dir_name"); + log_errno("get_current_dir_name"); return -1; } } ret = chdir(dir); if (ret < 0) { - print_errno("chdir"); + log_errno("chdir"); goto free_old; } @@ -76,7 +76,7 @@ int file_read(int fd, char **output, size_t *len) ssize_t read_now = read(fd, buf, buf_len); if (read_now < 0) { - print_errno("read"); + log_errno("read"); ret = read_now; goto free_output; } @@ -86,7 +86,7 @@ int file_read(int fd, char **output, size_t *len) *output = realloc(*output, *len + read_now + 1); if (!*output) { - print_errno("realloc"); + log_errno("realloc"); return -1; } memcpy(*output + *len, buf, read_now); -- cgit v1.2.3