hikey960: Fix debug-hifi to print the DSP logs am: 06a976ae2e am: a2bd650496
am: e132328ca9
Change-Id: I0556a589836efb18b986040be0ee062df42750db
diff --git a/hifi/debug-hifi/debug-hifi.c b/hifi/debug-hifi/debug-hifi.c
index 5e1fcd8..75bda4c 100644
--- a/hifi/debug-hifi/debug-hifi.c
+++ b/hifi/debug-hifi/debug-hifi.c
@@ -57,10 +57,10 @@
dump_buf.buf_size = memsize;
dump_buf.clear = clear;
ret = ioctl(hifi_dsp_fd, HIFI_MISC_IOCTL_DISPLAY_MSG, &dump_buf);
- if (ret) {
+ if (ret < 0) { /* This IOCTL returns buffer size */
ALOGE("Error %d accessing message buffer", errno);
} else {
- printf("%s\n", buffer);
+ printf("%s\n", ret > 0 ? buffer : "Buffer is empty");
}
free(buffer);
out0: