]> code.delx.au - pulseaudio/blobdiff - src/polypcore/protocol-esound.c
* split pa_cstrerror() into its own file polypcore/core-error.[ch]
[pulseaudio] / src / polypcore / protocol-esound.c
index 8f53694e7142efaac82fbb37b138c5c2a7b21d0a..02e140b953f05a939739aa907efa577db5a482f2 100644 (file)
@@ -31,6 +31,7 @@
 #include <limits.h>
 
 #include <polyp/sample.h>
+#include <polyp/timeval.h>
 #include <polyp/utf8.h>
 #include <polyp/xmalloc.h>
 
@@ -46,7 +47,8 @@
 #include <polypcore/authkey.h>
 #include <polypcore/namereg.h>
 #include <polypcore/log.h>
-#include <polypcore/util.h>
+#include <polypcore/core-util.h>
+#include <polypcore/core-error.h>
 
 #include "endianmacros.h"
 
@@ -513,7 +515,6 @@ static int esd_proto_server_info(struct connection *c, PA_GCC_UNUSED esd_proto_t
 }
 
 static int esd_proto_all_info(struct connection *c, esd_proto_t request, const void *data, size_t length) {
-    uint8_t *response;
     size_t t, k, s;
     struct connection *conn;
     uint32_t idx = PA_IDXSET_INVALID;
@@ -583,7 +584,6 @@ static int esd_proto_all_info(struct connection *c, esd_proto_t request, const v
     }
 
     assert(t == s*(nsamples+1)+k);
-    response += k;
     t -= k;
 
     connection_write(c, terminator, k);
@@ -811,7 +811,7 @@ static int do_read(struct connection *c) {
         assert(c->read_data_length < sizeof(c->request));
 
         if ((r = pa_iochannel_read(c->io, ((uint8_t*) &c->request) + c->read_data_length, sizeof(c->request) - c->read_data_length)) <= 0) {
-            pa_log_debug(__FILE__": read() failed: %s", r < 0 ? strerror(errno) : "EOF");
+            pa_log_debug(__FILE__": read(): %s", r < 0 ? pa_cstrerror(errno) : "EOF");
             return -1;
         }
 
@@ -859,7 +859,7 @@ static int do_read(struct connection *c) {
         assert(c->read_data && c->read_data_length < handler->data_length);
 
         if ((r = pa_iochannel_read(c->io, (uint8_t*) c->read_data + c->read_data_length, handler->data_length - c->read_data_length)) <= 0) {
-            pa_log_debug(__FILE__": read() failed: %s", r < 0 ? strerror(errno) : "EOF");
+            pa_log_debug(__FILE__": read(): %s", r < 0 ? pa_cstrerror(errno) : "EOF");
             return -1;
         }
 
@@ -879,7 +879,7 @@ static int do_read(struct connection *c) {
         assert(c->scache.memchunk.memblock && c->scache.name && c->scache.memchunk.index < c->scache.memchunk.length);
         
         if ((r = pa_iochannel_read(c->io, (uint8_t*) c->scache.memchunk.memblock->data+c->scache.memchunk.index, c->scache.memchunk.length-c->scache.memchunk.index)) <= 0) {
-            pa_log_debug(__FILE__": read() failed: %s", r < 0 ? strerror(errno) : "EOF");
+            pa_log_debug(__FILE__": read(): %s", r < 0 ? pa_cstrerror(errno) : "EOF");
             return -1;
         }
 
@@ -934,7 +934,7 @@ static int do_read(struct connection *c) {
         }
 
         if ((r = pa_iochannel_read(c->io, (uint8_t*) c->playback.current_memblock->data+c->playback.memblock_index, l)) <= 0) {
-            pa_log_debug(__FILE__": read() failed: %s", r < 0 ? strerror(errno) : "EOF");
+            pa_log_debug(__FILE__": read(): %s", r < 0 ? pa_cstrerror(errno) : "EOF");
             return -1;
         }
         
@@ -964,7 +964,7 @@ static int do_write(struct connection *c) {
         
         assert(c->write_data_index < c->write_data_length);
         if ((r = pa_iochannel_write(c->io, (uint8_t*) c->write_data+c->write_data_index, c->write_data_length-c->write_data_index)) < 0) {
-            pa_log(__FILE__": write() failed: %s", strerror(errno));
+            pa_log(__FILE__": write(): %s", pa_cstrerror(errno));
             return -1;
         }
         
@@ -983,7 +983,7 @@ static int do_write(struct connection *c) {
         
         if ((r = pa_iochannel_write(c->io, (uint8_t*) chunk.memblock->data+chunk.index, chunk.length)) < 0) {
             pa_memblock_unref(chunk.memblock);
-            pa_log(__FILE__": write(): %s", strerror(errno));
+            pa_log(__FILE__": write(): %s", pa_cstrerror(errno));
             return -1;
         }