logger: fix _min_write_chunk comparison and set file descriptor after closing it

This commit is contained in:
Beat Küng
2016-05-02 15:09:11 +02:00
committed by Lorenz Meier
parent 8b5a325644
commit 3dade23e39
+2 -1
View File
@@ -134,7 +134,7 @@ void LogWriter::run()
available = get_read_ptr(&read_ptr, &is_part);
/* if sufficient data available or partial read or terminating, exit this wait loop */
if ((available > _min_write_chunk) || is_part || !_should_run) {
if ((available >= _min_write_chunk) || is_part || !_should_run) {
/* GOTO end of block */
break;
}
@@ -182,6 +182,7 @@ void LogWriter::run()
_count = 0;
int res = ::close(_fd);
_fd = -1;
if (res) {
PX4_WARN("error closing log file");