Skip to content

Commit

Permalink
fixup! auditlog: Can only be opened once now (error on second open)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukego committed Dec 19, 2017
1 parent 541d60d commit de0f442
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lj_auditlog.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ int lj_auditlog_open(const char *path)
if (!ensure_log_started()) return 0;
newfp = fopen(path, "wb+");
/* Migrate log entries from memory buffer. */
fwrite(membuffer, 1, membuffersize, newfp);
fflush(fp);
if (fwrite(membuffer, 1, membuffersize, newfp) != membuffersize) return 0;
fp = newfp;
open = 1;
return 1;
Expand Down

0 comments on commit de0f442

Please sign in to comment.