Update elog_buf.c

pull/81/head
book诗意 5 years ago committed by GitHub
parent a29872cc71
commit f5918ab647
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -82,16 +82,16 @@ void elog_buf_output(const char *log, size_t size) {
* flush all buffered logs to output device * flush all buffered logs to output device
*/ */
void elog_flush(void) { void elog_flush(void) {
if(buf_write_size){ if(!buf_write_size)
/* lock output */ return;
elog_output_lock(); /* lock output */
/* output log */ elog_output_lock();
elog_port_output(log_buf, buf_write_size); /* output log */
/* reset write index */ elog_port_output(log_buf, buf_write_size);
buf_write_size = 0; /* reset write index */
/* unlock output */ buf_write_size = 0;
elog_output_unlock(); /* unlock output */
} elog_output_unlock();
} }
/** /**

Loading…
Cancel
Save