Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions code/bngblaster/src/bbl.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,15 @@ bbl_ctrl_job(timer_s *timer)
}
}

void
logfile_fflush_job(timer_s *timer)
{
UNUSED(timer);
if(g_log_fp) {
fflush(g_log_fp);
}
}

/**
* @brief BNG BLASTER MAIN FUNCTION
*
Expand Down Expand Up @@ -520,6 +529,11 @@ main(int argc, char *argv[])

/* Open logfile. */
log_open();
if(g_log_fp) {
timer_add_periodic(&g_ctx->timer_root, &g_ctx->logfile_fflush_timer,
"logfile fflush()", 0, 100 * MSEC, g_ctx,
&logfile_fflush_job);
}

/* Init config. */
bbl_config_init_defaults();
Expand Down
1 change: 1 addition & 0 deletions code/bngblaster/src/bbl_ctx.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ typedef struct bbl_ctx_
struct timer_ *smear_timer;
struct timer_ *stats_timer;
struct timer_ *keyboard_timer;
struct timer_ *logfile_fflush_timer;

struct timer_ *tcp_timer;
struct timer_ *fragmentation_timer;
Expand Down
Loading