From: Keith Packard Date: Sun, 16 Jan 2011 06:42:38 +0000 (-0800) Subject: altos: Flush log when full X-Git-Tag: debian/0.8.1+71+gda42f40~10 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=7a35b2d7048669a96256d4ea0086299f8a0cb1df altos: Flush log when full When the log storage is full, make sure any pending writes are flushed out so that the last bit isn't lost. Signed-off-by: Keith Packard --- diff --git a/src/ao_log.c b/src/ao_log.c index 8666482b..fa072550 100644 --- a/src/ao_log.c +++ b/src/ao_log.c @@ -42,8 +42,8 @@ ao_log_data(__xdata struct ao_log_record *log) __reentrant log->csum = 0; log->csum = ao_log_csum((__xdata uint8_t *) log); ao_mutex_get(&ao_log_mutex); { - if (ao_log_current_pos >= ao_log_end_pos) - ao_log_running = 0; + if (ao_log_current_pos >= ao_log_end_pos && ao_log_running) + ao_log_stop(); if (ao_log_running) { wrote = 1; ao_storage_write(ao_log_current_pos,