+/*
+ * print status line if line starts with known command.
+ */
+static int update_item(int item_num, char *buf)
+{
+ free(stat_content[item_num]);
+ stat_content[item_num] = para_strdup(buf);
+ print_stat_item(item_num);
+ return 1;
+}
+
+static int read_audiod_pipe(int fd)
+{
+ static char buf[8192];
+ static int loaded;
+ int ret;
+
+ if (loaded >= sizeof(buf)) /* overflow */
+ return 0;
+ ret = read(fd, buf + loaded, sizeof(buf) - loaded);
+ if (ret <= 0)
+ return ret;
+ loaded += ret;
+ ret = for_each_stat_item(buf, loaded, update_item);
+ if (ret < 0)
+ return ret;
+ loaded = ret;
+ return 1;
+}
+