diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2022-09-08 09:04:24 +0200 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2022-09-08 09:04:24 +0200 |
commit | 5e64d1c4b78c908e92a65e03fdc6817ffe59a8a6 (patch) | |
tree | 6472c8d0bf822c52b633804a39afc05351c0571b /src/file.c | |
parent | log: prepend timestamps (diff) | |
download | cimple-5e64d1c4b78c908e92a65e03fdc6817ffe59a8a6.tar.gz cimple-5e64d1c4b78c908e92a65e03fdc6817ffe59a8a6.zip |
log: refactoring
Diffstat (limited to '')
-rw-r--r-- | src/file.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -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); |