diff options
author | Michael Vetter <jubalh@iodoru.org> | 2021-06-28 19:39:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-28 19:39:49 +0200 |
commit | 6b9e9981132d7e2cd443a0cc29116dc79514e8b2 (patch) | |
tree | f62056397e6c81c427da932f2c2121c22dbaa16b | |
parent | dfae38c835e8e9b9f0dbf47deab1c3a1b377e8c2 (diff) | |
parent | 482f8955d7ee21515a82d1844620385ad4503079 (diff) | |
download | profani-tty-6b9e9981132d7e2cd443a0cc29116dc79514e8b2.tar.gz |
Merge pull request #1563 from profanity-im/fix/1518-logrot
Fix log rotation
-rw-r--r-- | src/log.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/log.c b/src/log.c index 6dfc089a..66fe8abe 100644 --- a/src/log.c +++ b/src/log.c @@ -246,18 +246,12 @@ _rotate_log_file(void) break; } - char* lf = strdup(mainlogfile); - char* start = strrchr(lf, '/') + 1; - char* end = strstr(start, ".log"); - *end = '\0'; - log_close(); rename(log_file, log_file_new); - log_init(log_get_filter(), start); + log_init(log_get_filter(), log_file); - free(lf); free(log_file_new); free(log_file); log_info("Log has been rotated"); |