hikey960: Fix debug-hifi to print the DSP logs
am: 06a976ae2e
Change-Id: I7c411c2ccde7a40beb067788311dbd539c06b34f
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: