diff options
author | James Booth <boothj5@gmail.com> | 2012-07-22 21:19:53 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2012-07-22 21:19:53 +0100 |
commit | 8e02720a69ab38977ab35cd0768bd04e5d97909c (patch) | |
tree | 92e2a6a766d75cea52a52eaae18000a2bac9cd8f | |
parent | 83ef1d562c0c8fa4148193c46bbc7f519c80badc (diff) | |
download | profani-tty-8e02720a69ab38977ab35cd0768bd04e5d97909c.tar.gz |
Flush after chat log writes
-rw-r--r-- | src/chat_log.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/chat_log.c b/src/chat_log.c index 3e685a96..89681924 100644 --- a/src/chat_log.c +++ b/src/chat_log.c @@ -25,26 +25,27 @@ #include "glib.h" -#include "log.h" +#include "chat_log.h" #include "common.h" static FILE *chatlog; -void chat_log_chat(const char * const user, const char * const msg) -{ - fprintf(chatlog, "%s: %s\n", user, msg); -} - void chat_log_init(void) { GString *log_file = g_string_new(getenv("HOME")); g_string_append(log_file, "/.profanity/log"); create_dir(log_file->str); g_string_append(log_file, "/chat.log"); - logp = fopen(log_file->str, "a"); + chatlog = fopen(log_file->str, "a"); g_string_free(log_file, TRUE); } +void chat_log_chat(const char * const user, const char * const msg) +{ + fprintf(chatlog, "%s: %s\n", user, msg); + fflush(chatlog); +} + void chat_log_close(void) { fclose(chatlog); |