-static void dccp_send(__unused struct audio_format *af,
- long unsigned current_chunk,
- __unused long unsigned chunks_sent, const char *buf, size_t len)
+static int dccp_write(int fd, const char *buf, size_t len)
+{
+ size_t send, written = 0;
+ int ret;
+again:
+ send = PARA_MIN(1024, len - written);
+ ret = write(fd, buf + written, send);
+ if (ret < 0)
+ goto err_out;
+ written += ret;
+ if (written >= len)
+ return written;
+ ret = write_ok(fd);
+ if (ret > 0)
+ goto again;
+err_out:
+ return -E_DCCP_WRITE;
+}
+
+static void dccp_send(long unsigned current_chunk,
+ __a_unused long unsigned chunks_sent, const char *buf, size_t len)