summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/kservice.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/kservice.c b/src/kservice.c
index 12878e67d1..fef284e8af 100644
--- a/src/kservice.c
+++ b/src/kservice.c
@@ -1114,11 +1114,11 @@ void rt_kprintf(const char *fmt, ...)
}
else
{
- rt_uint16_t old_flag = _console_device->flag;
+ rt_uint16_t old_flag = _console_device->open_flag;
- _console_device->flag |= RT_DEVICE_FLAG_STREAM;
+ _console_device->open_flag |= RT_DEVICE_FLAG_STREAM;
rt_device_write(_console_device, 0, rt_log_buf, length);
- _console_device->flag = old_flag;
+ _console_device->open_flag = old_flag;
}
#else
rt_hw_console_output(rt_log_buf);