diff options
author | Keith Packard <keithp@keithp.com> | 2011-01-15 22:42:38 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2011-01-16 14:34:54 -0800 |
commit | 7a35b2d7048669a96256d4ea0086299f8a0cb1df (patch) | |
tree | afcc05181cb3ed215c9f0417c392fa971ae765bb /src | |
parent | 47ee4597e55749e8f66f61a585ea32776979bf80 (diff) |
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 <keithp@keithp.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/ao_log.c | 4 |
1 files changed, 2 insertions, 2 deletions
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, |