Commit cb4b8d88 authored by Dimitris Lampridis's avatar Dimitris Lampridis Committed by Dimitris Lampridis

tools: detect truncated log messages

parent 7ba9936f
......@@ -36,7 +36,12 @@ static void print_logging (struct wrtd_dev *wrtd, int n_read)
do {
status = wrtd_get_next_event_log_entry(
wrtd, WRTD_LOG_ENTRY_SIZE, log_entry);
if (status != WRTD_SUCCESS) {
if (status > WRTD_SUCCESS) {
fprintf(stderr, "Warning: log entry truncated, "
"missing %d characters\n",
status - WRTD_LOG_ENTRY_SIZE);
}
else if (status != WRTD_SUCCESS) {
char error_message[256];
enum wrtd_status error_status;
wrtd_get_error (wrtd, &error_status, 256, error_message);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment