[polypaudio-commits] r945 - in /trunk: ./ src/ src/daemon/ src/modules/ src/modules/rtp/ src/polyp/ src/polypcore/ src/utils/

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Mon May 22 08:20:49 PDT 2006


Author: ossman
Date: Mon May 22 17:20:46 2006
New Revision: 945

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=945&root=polypaudio&view=rev
Log:
Wrap strerror() in a function that makes it thread safe and converts the
output to UTF-8.

Modified:
    trunk/configure.ac
    trunk/src/Makefile.am
    trunk/src/daemon/caps.c
    trunk/src/daemon/cpulimit.c
    trunk/src/daemon/daemon-conf.c
    trunk/src/daemon/main.c
    trunk/src/modules/module-alsa-source.c
    trunk/src/modules/module-detect.c
    trunk/src/modules/module-esound-compat-spawnfd.c
    trunk/src/modules/module-esound-compat-spawnpid.c
    trunk/src/modules/module-esound-sink.c
    trunk/src/modules/module-jack-sink.c
    trunk/src/modules/module-jack-source.c
    trunk/src/modules/module-match.c
    trunk/src/modules/module-mmkbd-evdev.c
    trunk/src/modules/module-oss-mmap.c
    trunk/src/modules/module-oss.c
    trunk/src/modules/module-pipe-sink.c
    trunk/src/modules/module-pipe-source.c
    trunk/src/modules/module-protocol-stub.c
    trunk/src/modules/module-solaris.c
    trunk/src/modules/module-volume-restore.c
    trunk/src/modules/oss-util.c
    trunk/src/modules/rtp/module-rtp-recv.c
    trunk/src/modules/rtp/module-rtp-send.c
    trunk/src/modules/rtp/rtp.c
    trunk/src/modules/rtp/sap.c
    trunk/src/polyp/client-conf.c
    trunk/src/polyp/context.c
    trunk/src/polyp/error.c
    trunk/src/polyp/error.h
    trunk/src/polyp/mainloop-signal.c
    trunk/src/polyp/mainloop.c
    trunk/src/polyp/util.c
    trunk/src/polypcore/authkey.c
    trunk/src/polypcore/cli-command.c
    trunk/src/polypcore/conf-parser.c
    trunk/src/polypcore/core-scache.c
    trunk/src/polypcore/core-util.c
    trunk/src/polypcore/iochannel.c
    trunk/src/polypcore/ioline.c
    trunk/src/polypcore/log.c
    trunk/src/polypcore/pid.c
    trunk/src/polypcore/protocol-esound.c
    trunk/src/polypcore/protocol-simple.c
    trunk/src/polypcore/socket-client.c
    trunk/src/polypcore/socket-server.c
    trunk/src/polypcore/socket-util.c
    trunk/src/utils/pacmd.c

Modified: trunk/configure.ac
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/configure.ac?rev=945&root=polypaudio&r1=944&r2=945&view=diff
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Mon May 22 17:20:46 2006
@@ -241,6 +241,9 @@
 
 # SUSv2
 AC_CHECK_FUNCS([ctime_r usleep])
+
+# SUSv3
+AC_CHECK_FUNCS([strerror_r])
 
 # BSD
 AC_CHECK_FUNCS([lstat])

Modified: trunk/src/Makefile.am
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/Makefile.am?rev=945&root=polypaudio&r1=944&r2=945&view=diff
==============================================================================
--- trunk/src/Makefile.am (original)
+++ trunk/src/Makefile.am Mon May 22 17:20:46 2006
@@ -499,6 +499,7 @@
 # Some public stuff is used even in the core.
 libpolypcore_la_SOURCES = \
 		polyp/channelmap.c polyp/channelmap.h \
+		polyp/error.c polyp/error.h \
 		polyp/mainloop.c polyp/mainloop.h \
 		polyp/mainloop-api.c polyp/mainloop-api.h \
 		polyp/mainloop-signal.c polyp/mainloop-signal.h \

Modified: trunk/src/daemon/caps.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/daemon/caps.c?rev=945&root=polypaudio&r1=944&r2=945&view=diff
==============================================================================
--- trunk/src/daemon/caps.c (original)
+++ trunk/src/daemon/caps.c Mon May 22 17:20:46 2006
@@ -31,6 +31,8 @@
 #ifdef HAVE_SYS_CAPABILITY_H
 #include <sys/capability.h>
 #endif
+
+#include <polyp/error.h>
 
 #include <polypcore/log.h>
 
@@ -110,7 +112,7 @@
     cap_clear(caps);
 
     if (cap_set_proc(caps) < 0) {
-        pa_log(__FILE__": failed to drop capabilities: %s", strerror(errno));
+        pa_log(__FILE__": failed to drop capabilities: %s", pa_cstrerror(errno));
         goto fail;
     }
     

Modified: trunk/src/daemon/cpulimit.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/daemon/cpulimit.c?rev=945&root=polypaudio&r1=944&r2=945&view=diff
==============================================================================
--- trunk/src/daemon/cpulimit.c (original)
+++ trunk/src/daemon/cpulimit.c Mon May 22 17:20:46 2006
@@ -23,6 +23,8 @@
 #include <config.h>
 #endif
 
+#include <polyp/error.h>
+
 #include <polypcore/core-util.h>
 #include <polypcore/log.h>
 
@@ -169,7 +171,7 @@
 
     /* Prepare the main loop pipe */
     if (pipe(the_pipe) < 0) {
-        pa_log(__FILE__": pipe() failed: %s", strerror(errno));
+        pa_log(__FILE__": pipe() failed: %s", pa_cstrerror(errno));
         return -1;
     }
 

Modified: trunk/src/daemon/daemon-conf.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/daemon/daemon-conf.c?rev=945&root=polypaudio&r1=944&r2=945&view=diff
==============================================================================
--- trunk/src/daemon/daemon-conf.c (original)
+++ trunk/src/daemon/daemon-conf.c Mon May 22 17:20:46 2006
@@ -29,6 +29,7 @@
 #include <assert.h>
 #include <unistd.h>
 
+#include <polyp/error.h>
 #include <polyp/xmalloc.h>
 
 #include <polypcore/core-util.h>
@@ -237,7 +238,7 @@
         pa_open_config_file(DEFAULT_CONFIG_FILE, DEFAULT_CONFIG_FILE_USER, ENV_CONFIG_FILE, &c->config_file, "r");
 
     if (!f && errno != ENOENT) {
-        pa_log(__FILE__": WARNING: failed to open configuration file '%s': %s", filename, strerror(errno));
+        pa_log(__FILE__": WARNING: failed to open configuration file '%s': %s", filename, pa_cstrerror(errno));
         goto finish;
     }
 

Modified: trunk/src/daemon/main.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/daemon/main.c?rev=945&root=polypaudio&r1=944&r2=945&view=diff
==============================================================================
--- trunk/src/daemon/main.c (original)
+++ trunk/src/daemon/main.c Mon May 22 17:20:46 2006
@@ -50,6 +50,7 @@
 
 #include "../polypcore/winsock.h"
 
+#include <polyp/error.h>
 #include <polyp/mainloop.h>
 #include <polyp/mainloop-signal.h>
 #include <polyp/xmalloc.h>
@@ -286,7 +287,7 @@
         }
         
         if ((child = fork()) < 0) {
-            pa_log(__FILE__": fork() failed: %s", strerror(errno));
+            pa_log(__FILE__": fork() failed: %s", pa_cstrerror(errno));
             goto finish;
         }
 
@@ -297,7 +298,7 @@
             daemon_pipe[1] = -1;
 
             if (pa_loop_read(daemon_pipe[0], &retval, sizeof(retval)) != sizeof(retval)) {
-                pa_log(__FILE__": read() failed: %s", strerror(errno));
+                pa_log(__FILE__": read() failed: %s", pa_cstrerror(errno));
                 retval = 1;
             }
 

Modified: trunk/src/modules/module-alsa-source.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-alsa-source.c?rev=945&root=polypaudio&r1=944&r2=945&view=diff
==============================================================================
--- trunk/src/modules/module-alsa-source.c (original)
+++ trunk/src/modules/module-alsa-source.c Mon May 22 17:20:46 2006
@@ -34,6 +34,7 @@
 
 #include <asoundlib.h>
 
+#include <polyp/error.h>
 #include <polyp/xmalloc.h>
 
 #include <polypcore/core.h>
@@ -134,7 +135,7 @@
                 continue;
             }
 
-            pa_log(__FILE__": snd_pcm_readi() failed: %s", strerror(-frames));
+            pa_log(__FILE__": snd_pcm_readi() failed: %s", pa_cstrerror(-frames));
             return;
         }
 

Modified: trunk/src/modules/module-detect.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-detect.c?rev=945&root=polypaudio&r1=944&r2=945&view=diff
==============================================================================
--- trunk/src/modules/module-detect.c (original)
+++ trunk/src/modules/module-detect.c Mon May 22 17:20:46 2006
@@ -33,6 +33,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 
+#include <polyp/error.h>
 #include <polyp/xmalloc.h>
 
 #include <polypcore/module.h>
@@ -56,7 +57,7 @@
     if (!(f = fopen("/proc/asound/devices", "r"))) {
 
         if (errno != ENOENT)
-            pa_log_error(__FILE__": open(\"/proc/asound/devices\") failed: %s", strerror(errno));
+            pa_log_error(__FILE__": open(\"/proc/asound/devices\") failed: %s", pa_cstrerror(errno));
         
         return -1;
     }
@@ -119,7 +120,7 @@
         !(f = fopen("/proc/asound/oss/sndstat", "r"))) {
 
         if (errno != ENOENT)
-            pa_log_error(__FILE__": failed to open OSS sndstat device: %s", strerror(errno));
+            pa_log_error(__FILE__": failed to open OSS sndstat device: %s", pa_cstrerror(errno));
 
         return -1;
     }
@@ -175,7 +176,7 @@
 
     if (stat(dev, &s) < 0) {
         if (errno != ENOENT)
-            pa_log_error(__FILE__": failed to open device %s: %s", dev, strerror(errno));
+            pa_log_error(__FILE__": failed to open device %s: %s", dev, pa_cstrerror(errno));
         return -1;
     }
 

Modified: trunk/src/modules/module-esound-compat-spawnfd.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-esound-compat-spawnfd.c?rev=945&root=polypaudio&r1=944&r2=945&view=diff
==============================================================================
--- trunk/src/modules/module-esound-compat-spawnfd.c (original)
+++ trunk/src/modules/module-esound-compat-spawnfd.c Mon May 22 17:20:46 2006
@@ -27,6 +27,8 @@
 #include <assert.h>
 #include <string.h>
 #include <errno.h>
+
+#include <polyp/error.h>
 
 #include <polypcore/module.h>
 #include <polypcore/modargs.h>
@@ -59,7 +61,7 @@
     }
 
     if (pa_loop_write(fd, &x, sizeof(x)) != sizeof(x))
-        pa_log(__FILE__": WARNING: write(%u, 1, 1) failed: %s", fd, strerror(errno));
+        pa_log(__FILE__": WARNING: write(%u, 1, 1) failed: %s", fd, pa_cstrerror(errno));
 
     close(fd);
 

Modified: trunk/src/modules/module-esound-compat-spawnpid.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-esound-compat-spawnpid.c?rev=945&root=polypaudio&r1=944&r2=945&view=diff
==============================================================================
--- trunk/src/modules/module-esound-compat-spawnpid.c (original)
+++ trunk/src/modules/module-esound-compat-spawnpid.c Mon May 22 17:20:46 2006
@@ -27,6 +27,8 @@
 #include <string.h>
 #include <errno.h>
 #include <signal.h>
+
+#include <polyp/error.h>
 
 #include <polypcore/module.h>
 #include <polypcore/core-util.h>
@@ -59,7 +61,7 @@
     }
 
     if (kill(pid, SIGUSR1) < 0)
-        pa_log(__FILE__": WARNING: kill(%u) failed: %s", pid, strerror(errno));
+        pa_log(__FILE__": WARNING: kill(%u) failed: %s", pid, pa_cstrerror(errno));
 
     pa_module_unload_request(m);
 

Modified: trunk/src/modules/module-esound-sink.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-esound-sink.c?rev=945&root=polypaudio&r1=944&r2=945&view=diff
==============================================================================
--- trunk/src/modules/module-esound-sink.c (original)
+++ trunk/src/modules/module-esound-sink.c Mon May 22 17:20:46 2006
@@ -33,6 +33,7 @@
 #include <unistd.h>
 #include <limits.h>
 
+#include <polyp/error.h>
 #include <polyp/xmalloc.h>
 
 #include <polypcore/iochannel.h>
@@ -128,7 +129,7 @@
         assert(u->write_index < u->write_length);
 
         if ((r = pa_iochannel_write(u->io, (uint8_t*) u->write_data + u->write_index, u->write_length - u->write_index)) <= 0) {
-            pa_log(__FILE__": write() failed: %s", strerror(errno));
+            pa_log(__FILE__": write() failed: %s", pa_cstrerror(errno));
             return -1;
         }
 
@@ -150,7 +151,7 @@
         assert(u->memchunk.memblock && u->memchunk.length);
         
         if ((r = pa_iochannel_write(u->io, (uint8_t*) u->memchunk.memblock->data + u->memchunk.index, u->memchunk.length)) < 0) {
-            pa_log(__FILE__": write() failed: %s", strerror(errno));
+            pa_log(__FILE__": write() failed: %s", pa_cstrerror(errno));
             return -1;
         }
 
@@ -175,7 +176,7 @@
 
             /* Process auth data */
             if (!*(int32_t*) u->read_data) {
-                pa_log(__FILE__": Authentication failed: %s", strerror(errno));
+                pa_log(__FILE__": Authentication failed: %s", pa_cstrerror(errno));
                 return -1;
             }
 
@@ -245,7 +246,7 @@
         assert(u->read_index < u->read_length);
         
         if ((r = pa_iochannel_read(u->io, (uint8_t*) u->read_data + u->read_index, u->read_length - u->read_index)) <= 0) {
-            pa_log(__FILE__": read() failed: %s", r < 0 ? strerror(errno) : "EOF");
+            pa_log(__FILE__": read() failed: %s", r < 0 ? pa_cstrerror(errno) : "EOF");
             cancel(u);
             return -1;
         }
@@ -305,7 +306,7 @@
     u->client = NULL;
     
     if (!io) {
-        pa_log(__FILE__": connection failed: %s", strerror(errno));
+        pa_log(__FILE__": connection failed: %s", pa_cstrerror(errno));
         cancel(u);
         return;
     }

Modified: trunk/src/modules/module-jack-sink.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-jack-sink.c?rev=945&root=polypaudio&r1=944&r2=945&view=diff
==============================================================================
--- trunk/src/modules/module-jack-sink.c (original)
+++ trunk/src/modules/module-jack-sink.c Mon May 22 17:20:46 2006
@@ -36,6 +36,7 @@
 
 #include <jack/jack.h>
 
+#include <polyp/error.h>
 #include <polyp/xmalloc.h>
 
 #include <polypcore/iochannel.h>
@@ -272,7 +273,7 @@
     pthread_cond_init(&u->cond, NULL);
     
     if (pipe(u->pipe_fds) < 0) {
-        pa_log(__FILE__": pipe() failed: %s", strerror(errno));
+        pa_log(__FILE__": pipe() failed: %s", pa_cstrerror(errno));
         goto fail;
     }
 

Modified: trunk/src/modules/module-jack-source.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-jack-source.c?rev=945&root=polypaudio&r1=944&r2=945&view=diff
==============================================================================
--- trunk/src/modules/module-jack-source.c (original)
+++ trunk/src/modules/module-jack-source.c Mon May 22 17:20:46 2006
@@ -36,6 +36,7 @@
 
 #include <jack/jack.h>
 
+#include <polyp/error.h>
 #include <polyp/xmalloc.h>
 
 #include <polypcore/iochannel.h>
@@ -270,7 +271,7 @@
     pthread_cond_init(&u->cond, NULL);
     
     if (pipe(u->pipe_fds) < 0) {
-        pa_log(__FILE__": pipe() failed: %s", strerror(errno));
+        pa_log(__FILE__": pipe() failed: %s", pa_cstrerror(errno));
         goto fail;
     }
 

Modified: trunk/src/modules/module-match.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-match.c?rev=945&root=polypaudio&r1=944&r2=945&view=diff
==============================================================================
--- trunk/src/modules/module-match.c (original)
+++ trunk/src/modules/module-match.c Mon May 22 17:20:46 2006
@@ -32,6 +32,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
+#include <polyp/error.h>
 #include <polyp/xmalloc.h>
 
 #include <polypcore/module.h>
@@ -86,7 +87,7 @@
         pa_open_config_file(DEFAULT_MATCH_TABLE_FILE, DEFAULT_MATCH_TABLE_FILE_USER, NULL, &fn, "r");
 
     if (!f) {
-        pa_log(__FILE__": failed to open file '%s': %s", fn, strerror(errno));
+        pa_log(__FILE__": failed to open file '%s': %s", fn, pa_cstrerror(errno));
         goto finish;
     }
 

Modified: trunk/src/modules/module-mmkbd-evdev.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-mmkbd-evdev.c?rev=945&root=polypaudio&r1=944&r2=945&view=diff
==============================================================================
--- trunk/src/modules/module-mmkbd-evdev.c (original)
+++ trunk/src/modules/module-mmkbd-evdev.c Mon May 22 17:20:46 2006
@@ -33,6 +33,7 @@
 
 #include <linux/input.h>
 
+#include <polyp/error.h>
 #include <polyp/xmalloc.h>
 
 #include <polypcore/module.h>
@@ -89,7 +90,7 @@
         struct input_event ev;
 
         if (pa_loop_read(u->fd, &ev, sizeof(ev)) <= 0) {
-            pa_log(__FILE__": failed to read from event device: %s", strerror(errno));
+            pa_log(__FILE__": failed to read from event device: %s", pa_cstrerror(errno));
             goto fail;
         }
 
@@ -183,19 +184,19 @@
     u->fd = -1;
 
     if ((u->fd = open(pa_modargs_get_value(ma, "device", DEFAULT_DEVICE), O_RDONLY)) < 0) {
-        pa_log(__FILE__": failed to open evdev device: %s", strerror(errno));
+        pa_log(__FILE__": failed to open evdev device: %s", pa_cstrerror(errno));
         goto fail;
     }
 
     if (ioctl(u->fd, EVIOCGVERSION, &version) < 0) {
-        pa_log(__FILE__": EVIOCGVERSION failed: %s", strerror(errno));
+        pa_log(__FILE__": EVIOCGVERSION failed: %s", pa_cstrerror(errno));
         goto fail;
     }
 
     pa_log_info(__FILE__": evdev driver version %i.%i.%i", version >> 16, (version >> 8) & 0xff, version & 0xff);
 
     if(ioctl(u->fd, EVIOCGID, &input_id)) {
-        pa_log(__FILE__": EVIOCGID failed: %s", strerror(errno));
+        pa_log(__FILE__": EVIOCGID failed: %s", pa_cstrerror(errno));
         goto fail;
     }
 
@@ -204,7 +205,7 @@
 
     memset(name, 0, sizeof(name));
     if(ioctl(u->fd, EVIOCGNAME(sizeof(name)), name) < 0) {
-        pa_log(__FILE__": EVIOCGNAME failed: %s", strerror(errno));
+        pa_log(__FILE__": EVIOCGNAME failed: %s", pa_cstrerror(errno));
         goto fail;
     }
 
@@ -212,7 +213,7 @@
 
     memset(evtype_bitmask, 0, sizeof(evtype_bitmask));
     if (ioctl(u->fd, EVIOCGBIT(0, EV_MAX), evtype_bitmask) < 0) {
-        pa_log(__FILE__": EVIOCGBIT failed: %s", strerror(errno));
+        pa_log(__FILE__": EVIOCGBIT failed: %s", pa_cstrerror(errno));
         goto fail;
     }
 

Modified: trunk/src/modules/module-oss-mmap.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-oss-mmap.c?rev=945&root=polypaudio&r1=944&r2=945&view=diff
==============================================================================
--- trunk/src/modules/module-oss-mmap.c (original)
+++ trunk/src/modules/module-oss-mmap.c Mon May 22 17:20:46 2006
@@ -36,6 +36,7 @@
 #include <limits.h>
 #include <sys/mman.h>
 
+#include <polyp/error.h>
 #include <polyp/xmalloc.h>
 
 #include <polypcore/iochannel.h>
@@ -152,7 +153,7 @@
     update_usage(u);
     
     if (ioctl(u->fd, SNDCTL_DSP_GETOPTR, &info) < 0) {
-        pa_log(__FILE__": SNDCTL_DSP_GETOPTR: %s", strerror(errno));
+        pa_log(__FILE__": SNDCTL_DSP_GETOPTR: %s", pa_cstrerror(errno));
         return;
     }
 
@@ -215,7 +216,7 @@
     update_usage(u);
     
     if (ioctl(u->fd, SNDCTL_DSP_GETIPTR, &info) < 0) {
-        pa_log(__FILE__": SNDCTL_DSP_GETIPTR: %s", strerror(errno));
+        pa_log(__FILE__": SNDCTL_DSP_GETIPTR: %s", pa_cstrerror(errno));
         return;
     }
 
@@ -246,7 +247,7 @@
     assert(s && u);
 
     if (ioctl(u->fd, SNDCTL_DSP_GETOPTR, &info) < 0) {
-        pa_log(__FILE__": SNDCTL_DSP_GETOPTR: %s", strerror(errno));
+        pa_log(__FILE__": SNDCTL_DSP_GETOPTR: %s", pa_cstrerror(errno));
         return 0;
     }
 
@@ -272,7 +273,7 @@
     assert(s && u);
 
     if (ioctl(u->fd, SNDCTL_DSP_GETIPTR, &info) < 0) {
-        pa_log(__FILE__": SNDCTL_DSP_GETIPTR: %s", strerror(errno));
+        pa_log(__FILE__": SNDCTL_DSP_GETIPTR: %s", pa_cstrerror(errno));
         return 0;
     }
 
@@ -295,7 +296,7 @@
     struct userdata *u = s->userdata;
 
     if (pa_oss_get_pcm_volume(u->fd, &s->sample_spec, &s->hw_volume) < 0) {
-        pa_log_info(__FILE__": device doesn't support reading mixer settings: %s", strerror(errno));
+        pa_log_info(__FILE__": device doesn't support reading mixer settings: %s", pa_cstrerror(errno));
         s->get_hw_volume = NULL;
         return -1;
     }
@@ -307,7 +308,7 @@
     struct userdata *u = s->userdata;
 
     if (pa_oss_set_pcm_volume(u->fd, &s->sample_spec, &s->hw_volume) < 0) {
-        pa_log_info(__FILE__": device doesn't support writing mixer settings: %s", strerror(errno));
+        pa_log_info(__FILE__": device doesn't support writing mixer settings: %s", pa_cstrerror(errno));
         s->set_hw_volume = NULL;
         return -1;
     }
@@ -319,7 +320,7 @@
     struct userdata *u = s->userdata;
 
     if (pa_oss_get_input_volume(u->fd, &s->sample_spec, &s->hw_volume) < 0) {
-        pa_log_info(__FILE__": device doesn't support reading mixer settings: %s", strerror(errno));
+        pa_log_info(__FILE__": device doesn't support reading mixer settings: %s", pa_cstrerror(errno));
         s->get_hw_volume = NULL;
         return -1;
     }
@@ -331,7 +332,7 @@
     struct userdata *u = s->userdata;
 
     if (pa_oss_set_input_volume(u->fd, &s->sample_spec, &s->hw_volume) < 0) {
-        pa_log_info(__FILE__": device doesn't support writing mixer settings: %s", strerror(errno));
+        pa_log_info(__FILE__": device doesn't support writing mixer settings: %s", pa_cstrerror(errno));
         s->set_hw_volume = NULL;
         return -1;
     }
@@ -413,7 +414,7 @@
 
     if (mode != O_WRONLY) {
         if (ioctl(u->fd, SNDCTL_DSP_GETISPACE, &info) < 0) {
-            pa_log(__FILE__": SNDCTL_DSP_GETISPACE: %s", strerror(errno));
+            pa_log(__FILE__": SNDCTL_DSP_GETISPACE: %s", pa_cstrerror(errno));
             goto fail;
         }
 
@@ -425,7 +426,7 @@
                 pa_log(__FILE__": mmap failed for input. Changing to O_WRONLY mode.");
                 mode = O_WRONLY;
             } else {
-                pa_log(__FILE__": mmap(): %s", strerror(errno));
+                pa_log(__FILE__": mmap(): %s", pa_cstrerror(errno));
                 goto fail;
             }
         } else {
@@ -452,7 +453,7 @@
 
     if (mode != O_RDONLY) {
         if (ioctl(u->fd, SNDCTL_DSP_GETOSPACE, &info) < 0) {
-            pa_log(__FILE__": SNDCTL_DSP_GETOSPACE: %s", strerror(errno));
+            pa_log(__FILE__": SNDCTL_DSP_GETOSPACE: %s", pa_cstrerror(errno));
             goto fail;
         }
         
@@ -464,7 +465,7 @@
                 pa_log(__FILE__": mmap filed for output. Changing to O_RDONLY mode.");
                 mode = O_RDONLY;
             } else {
-                pa_log(__FILE__": mmap(): %s", strerror(errno));
+                pa_log(__FILE__": mmap(): %s", pa_cstrerror(errno));
                 goto fail;
             }
         } else {
@@ -492,12 +493,12 @@
 
     zero = 0;
     if (ioctl(u->fd, SNDCTL_DSP_SETTRIGGER, &zero) < 0) {
-        pa_log(__FILE__": SNDCTL_DSP_SETTRIGGER: %s", strerror(errno));
+        pa_log(__FILE__": SNDCTL_DSP_SETTRIGGER: %s", pa_cstrerror(errno));
         goto fail;
     }
     
     if (ioctl(u->fd, SNDCTL_DSP_SETTRIGGER, &enable_bits) < 0) {
-        pa_log(__FILE__": SNDCTL_DSP_SETTRIGGER: %s", strerror(errno));
+        pa_log(__FILE__": SNDCTL_DSP_SETTRIGGER: %s", pa_cstrerror(errno));
         goto fail;
     }
         

Modified: trunk/src/modules/module-oss.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-oss.c?rev=945&root=polypaudio&r1=944&r2=945&view=diff
==============================================================================
--- trunk/src/modules/module-oss.c (original)
+++ trunk/src/modules/module-oss.c Mon May 22 17:20:46 2006
@@ -35,6 +35,7 @@
 #include <unistd.h>
 #include <limits.h>
 
+#include <polyp/error.h>
 #include <polyp/xmalloc.h>
 
 #include <polypcore/iochannel.h>
@@ -146,7 +147,7 @@
         assert(memchunk->length);
         
         if ((r = pa_iochannel_write(u->io, (uint8_t*) memchunk->memblock->data + memchunk->index, memchunk->length)) < 0) {
-            pa_log(__FILE__": write() failed: %s", strerror(errno));
+            pa_log(__FILE__": write() failed: %s", pa_cstrerror(errno));
             break;
         }
         
@@ -199,7 +200,7 @@
         if ((r = pa_iochannel_read(u->io, memchunk.memblock->data, memchunk.memblock->length)) < 0) {
             pa_memblock_unref(memchunk.memblock);
             if (errno != EAGAIN)
-                pa_log(__FILE__": read() failed: %s", strerror(errno));
+                pa_log(__FILE__": read() failed: %s", pa_cstrerror(errno));
             break;
         }
         
@@ -234,7 +235,7 @@
     assert(s && u && u->sink);
 
     if (ioctl(u->fd, SNDCTL_DSP_GETODELAY, &arg) < 0) {
-        pa_log_info(__FILE__": device doesn't support SNDCTL_DSP_GETODELAY: %s", strerror(errno));
+        pa_log_info(__FILE__": device doesn't support SNDCTL_DSP_GETODELAY: %s", pa_cstrerror(errno));
         s->get_latency = NULL;
         return 0;
     }
@@ -270,7 +271,7 @@
     struct userdata *u = s->userdata;
 
     if (pa_oss_get_pcm_volume(u->fd, &s->sample_spec, &s->hw_volume) < 0) {
-        pa_log_info(__FILE__": device doesn't support reading mixer settings: %s", strerror(errno));
+        pa_log_info(__FILE__": device doesn't support reading mixer settings: %s", pa_cstrerror(errno));
         s->get_hw_volume = NULL;
         return -1;
     }
@@ -282,7 +283,7 @@
     struct userdata *u = s->userdata;
 
     if (pa_oss_set_pcm_volume(u->fd, &s->sample_spec, &s->hw_volume) < 0) {
-        pa_log_info(__FILE__": device doesn't support writing mixer settings: %s", strerror(errno));
+        pa_log_info(__FILE__": device doesn't support writing mixer settings: %s", pa_cstrerror(errno));
         s->set_hw_volume = NULL;
         return -1;
     }
@@ -294,7 +295,7 @@
     struct userdata *u = s->userdata;
 
     if (pa_oss_get_input_volume(u->fd, &s->sample_spec, &s->hw_volume) < 0) {
-        pa_log_info(__FILE__": device doesn't support reading mixer settings: %s", strerror(errno));
+        pa_log_info(__FILE__": device doesn't support reading mixer settings: %s", pa_cstrerror(errno));
         s->get_hw_volume = NULL;
         return -1;
     }
@@ -306,7 +307,7 @@
     struct userdata *u = s->userdata;
 
     if (pa_oss_set_input_volume(u->fd, &s->sample_spec, &s->hw_volume) < 0) {
-        pa_log_info(__FILE__": device doesn't support writing mixer settings: %s", strerror(errno));
+        pa_log_info(__FILE__": device doesn't support writing mixer settings: %s", pa_cstrerror(errno));
         s->set_hw_volume = NULL;
         return -1;
     }
@@ -380,7 +381,7 @@
         goto fail;
 
     if (ioctl(fd, SNDCTL_DSP_GETBLKSIZE, &frag_size) < 0) {
-        pa_log(__FILE__": SNDCTL_DSP_GETBLKSIZE: %s", strerror(errno));
+        pa_log(__FILE__": SNDCTL_DSP_GETBLKSIZE: %s", pa_cstrerror(errno));
         goto fail;
     }
     assert(frag_size);

Modified: trunk/src/modules/module-pipe-sink.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-pipe-sink.c?rev=945&root=polypaudio&r1=944&r2=945&view=diff
==============================================================================
--- trunk/src/modules/module-pipe-sink.c (original)
+++ trunk/src/modules/module-pipe-sink.c Mon May 22 17:20:46 2006
@@ -33,6 +33,7 @@
 #include <unistd.h>
 #include <limits.h>
 
+#include <polyp/error.h>
 #include <polyp/xmalloc.h>
 
 #include <polypcore/iochannel.h>
@@ -99,7 +100,7 @@
     assert(u->memchunk.memblock && u->memchunk.length);
     
     if ((r = pa_iochannel_write(u->io, (uint8_t*) u->memchunk.memblock->data + u->memchunk.index, u->memchunk.length)) < 0) {
-        pa_log(__FILE__": write() failed: %s", strerror(errno));
+        pa_log(__FILE__": write(): %s", pa_cstrerror(errno));
         return;
     }
 
@@ -163,14 +164,14 @@
     mkfifo(p = pa_modargs_get_value(ma, "file", DEFAULT_FIFO_NAME), 0777);
 
     if ((fd = open(p, O_RDWR)) < 0) {
-        pa_log(__FILE__": open('%s'): %s", p, strerror(errno));
+        pa_log(__FILE__": open('%s'): %s", p, pa_cstrerror(errno));
         goto fail;
     }
 
     pa_fd_set_cloexec(fd, 1);
     
     if (fstat(fd, &st) < 0) {
-        pa_log(__FILE__": fstat('%s'): %s", p, strerror(errno));
+        pa_log(__FILE__": fstat('%s'): %s", p, pa_cstrerror(errno));
         goto fail;
     }
 

Modified: trunk/src/modules/module-pipe-source.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-pipe-source.c?rev=945&root=polypaudio&r1=944&r2=945&view=diff
==============================================================================
--- trunk/src/modules/module-pipe-source.c (original)
+++ trunk/src/modules/module-pipe-source.c Mon May 22 17:20:46 2006
@@ -33,6 +33,7 @@
 #include <unistd.h>
 #include <limits.h>
 
+#include <polyp/error.h>
 #include <polyp/xmalloc.h>
 
 #include <polypcore/iochannel.h>
@@ -96,7 +97,7 @@
 
     assert(u->chunk.memblock && u->chunk.memblock->length > u->chunk.index);
     if ((r = pa_iochannel_read(u->io, (uint8_t*) u->chunk.memblock->data + u->chunk.index, u->chunk.memblock->length - u->chunk.index)) <= 0) {
-        pa_log(__FILE__": read() failed: %s", strerror(errno));
+        pa_log(__FILE__": read(): %s", pa_cstrerror(errno));
         return;
     }
 
@@ -141,14 +142,14 @@
     mkfifo(p = pa_modargs_get_value(ma, "file", DEFAULT_FIFO_NAME), 0777);
 
     if ((fd = open(p, O_RDWR)) < 0) {
-        pa_log(__FILE__": open('%s'): %s", p, strerror(errno));
+        pa_log(__FILE__": open('%s'): %s", p, pa_cstrerror(errno));
         goto fail;
     }
 
     pa_fd_set_cloexec(fd, 1);
     
     if (fstat(fd, &st) < 0) {
-        pa_log(__FILE__": fstat('%s'): %s", p, strerror(errno));
+        pa_log(__FILE__": fstat('%s'): %s", p, pa_cstrerror(errno));
         goto fail;
     }
 

Modified: trunk/src/modules/module-protocol-stub.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-protocol-stub.c?rev=945&root=polypaudio&r1=944&r2=945&view=diff
==============================================================================
--- trunk/src/modules/module-protocol-stub.c (original)
+++ trunk/src/modules/module-protocol-stub.c Mon May 22 17:20:46 2006
@@ -42,6 +42,7 @@
 
 #include "../polypcore/winsock.h"
 
+#include <polyp/error.h>
 #include <polyp/xmalloc.h>
 
 #include <polypcore/module.h>
@@ -250,7 +251,7 @@
     }
 
     if ((r = pa_unix_socket_remove_stale(tmp)) < 0) {
-        pa_log(__FILE__": Failed to remove stale UNIX socket '%s': %s", tmp, strerror(errno));
+        pa_log(__FILE__": Failed to remove stale UNIX socket '%s': %s", tmp, pa_cstrerror(errno));
         goto fail;
     }
     
@@ -328,7 +329,7 @@
         
         if ((p = pa_parent_dir(u->socket_path))) {
             if (rmdir(p) < 0 && errno != ENOENT && errno != ENOTEMPTY)
-                pa_log(__FILE__": Failed to remove %s: %s.", u->socket_path, strerror(errno));
+                pa_log(__FILE__": Failed to remove %s: %s.", u->socket_path, pa_cstrerror(errno));
 
             pa_xfree(p);
         }

Modified: trunk/src/modules/module-solaris.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-solaris.c?rev=945&root=polypaudio&r1=944&r2=945&view=diff
==============================================================================
--- trunk/src/modules/module-solaris.c (original)
+++ trunk/src/modules/module-solaris.c Mon May 22 17:20:46 2006
@@ -40,6 +40,7 @@
 #include <sys/conf.h>
 #include <sys/audio.h>
 
+#include <polyp/error.h>
 #include <polyp/mainloop-signal.h>
 #include <polyp/xmalloc.h>
 
@@ -168,7 +169,7 @@
     }
 
     if ((r = pa_iochannel_write(u->io, (uint8_t*) memchunk->memblock->data + memchunk->index, len)) < 0) {
-        pa_log(__FILE__": write() failed: %s", strerror(errno));
+        pa_log(__FILE__": write() failed: %s", pa_cstrerror(errno));
         return;
     }
 
@@ -206,7 +207,7 @@
     if ((r = pa_iochannel_read(u->io, memchunk.memblock->data, memchunk.memblock->length)) < 0) {
         pa_memblock_unref(memchunk.memblock);
         if (errno != EAGAIN)
-            pa_log(__FILE__": read() failed: %s", strerror(errno));
+            pa_log(__FILE__": read() failed: %s", pa_cstrerror(errno));
         return;
     }
     
@@ -334,7 +335,7 @@
         if (errno == EINVAL)
             pa_log(__FILE__": AUDIO_SETINFO: Unsupported volume.");
         else
-            pa_log(__FILE__": AUDIO_SETINFO: %s", strerror(errno));
+            pa_log(__FILE__": AUDIO_SETINFO: %s", pa_cstrerror(errno));
         return -1;
     }
 
@@ -363,7 +364,7 @@
     info.output_muted = !!s->hw_muted;
 
     if (ioctl(u->fd, AUDIO_SETINFO, &info) < 0) {
-        pa_log(__FILE__": AUDIO_SETINFO: %s", strerror(errno));
+        pa_log(__FILE__": AUDIO_SETINFO: %s", pa_cstrerror(errno));
         return -1;
     }
 
@@ -397,7 +398,7 @@
         if (errno == EINVAL)
             pa_log(__FILE__": AUDIO_SETINFO: Unsupported volume.");
         else
-            pa_log(__FILE__": AUDIO_SETINFO: %s", strerror(errno));
+            pa_log(__FILE__": AUDIO_SETINFO: %s", pa_cstrerror(errno));
         return -1;
     }
 
@@ -463,7 +464,7 @@
         if (errno == EINVAL)
             pa_log(__FILE__": AUDIO_SETINFO: Unsupported sample format.");
         else
-            pa_log(__FILE__": AUDIO_SETINFO: %s", strerror(errno));
+            pa_log(__FILE__": AUDIO_SETINFO: %s", pa_cstrerror(errno));
         return -1;
     }
 
@@ -481,7 +482,7 @@
         if (errno == EINVAL)
             pa_log(__FILE__": AUDIO_SETINFO: Unsupported buffer size.");
         else
-            pa_log(__FILE__": AUDIO_SETINFO: %s", strerror(errno));
+            pa_log(__FILE__": AUDIO_SETINFO: %s", pa_cstrerror(errno));
         return -1;
     }
 

Modified: trunk/src/modules/module-volume-restore.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-volume-restore.c?rev=945&root=polypaudio&r1=944&r2=945&view=diff
==============================================================================
--- trunk/src/modules/module-volume-restore.c (original)
+++ trunk/src/modules/module-volume-restore.c Mon May 22 17:20:46 2006
@@ -32,6 +32,7 @@
 #include <stdlib.h>
 #include <ctype.h>
 
+#include <polyp/error.h>
 #include <polyp/xmalloc.h>
 
 #include <polypcore/module.h>
@@ -124,7 +125,7 @@
             pa_log_info(__FILE__": starting with empty ruleset.");
             ret = 0;
         } else
-            pa_log(__FILE__": failed to open file '%s': %s", u->table_file, strerror(errno));
+            pa_log(__FILE__": failed to open file '%s': %s", u->table_file, pa_cstrerror(errno));
         
         goto finish;
     }
@@ -198,7 +199,7 @@
         pa_open_config_file(NULL, DEFAULT_VOLUME_TABLE_FILE, NULL, &u->table_file, "w");
 
     if (!f) {
-        pa_log(__FILE__": failed to open file '%s': %s", u->table_file, strerror(errno));
+        pa_log(__FILE__": failed to open file '%s': %s", u->table_file, pa_cstrerror(errno));
         goto finish;
     }
 

Modified: trunk/src/modules/oss-util.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/oss-util.c?rev=945&root=polypaudio&r1=944&r2=945&view=diff
==============================================================================
--- trunk/src/modules/oss-util.c (original)
+++ trunk/src/modules/oss-util.c Mon May 22 17:20:46 2006
@@ -34,6 +34,8 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 
+#include <polyp/error.h>
+
 #include <polypcore/core-util.h>
 #include <polypcore/log.h>
 
@@ -51,7 +53,7 @@
             tcaps = pcaps ? pcaps : &dcaps;
             
             if (ioctl(fd, SNDCTL_DSP_GETCAPS, tcaps) < 0) {
-                pa_log(__FILE__": SNDCTL_DSP_GETCAPS: %s", strerror(errno));
+                pa_log(__FILE__": SNDCTL_DSP_GETCAPS: %s", pa_cstrerror(errno));
                 goto fail;
             }
 
@@ -65,13 +67,13 @@
         
         if ((fd = open(device, (*mode = O_WRONLY)|O_NDELAY)) < 0) {
             if ((fd = open(device, (*mode = O_RDONLY)|O_NDELAY)) < 0) {
-                pa_log(__FILE__": open('%s'): %s", device, strerror(errno));
+                pa_log(__FILE__": open('%s'): %s", device, pa_cstrerror(errno));
                 goto fail;
             }
         }
     } else {
         if ((fd = open(device, *mode|O_NDELAY)) < 0) {
-            pa_log(__FILE__": open('%s'): %s", device, strerror(errno));
+            pa_log(__FILE__": open('%s'): %s", device, pa_cstrerror(errno));
             goto fail;
         }
     } 
@@ -80,7 +82,7 @@
 
     if (pcaps) {
         if (ioctl(fd, SNDCTL_DSP_GETCAPS, pcaps) < 0) {
-            pa_log(__FILE__": SNDCTL_DSP_GETCAPS: %s", strerror(errno));
+            pa_log(__FILE__": SNDCTL_DSP_GETCAPS: %s", pa_cstrerror(errno));
             goto fail;
         }
     }
@@ -118,7 +120,7 @@
             if (ioctl(fd, SNDCTL_DSP_SETFMT, &format) < 0 || format != f) {
                 format = AFMT_U8;
                 if (ioctl(fd, SNDCTL_DSP_SETFMT, &format) < 0 || format != AFMT_U8) {
-                    pa_log(__FILE__": SNDCTL_DSP_SETFMT: %s", format != AFMT_U8 ? "No supported sample format" : strerror(errno));
+                    pa_log(__FILE__": SNDCTL_DSP_SETFMT: %s", format != AFMT_U8 ? "No supported sample format" : pa_cstrerror(errno));
                     return -1;
                 } else
                     ss->format = PA_SAMPLE_U8;
@@ -130,7 +132,7 @@
         
     channels = ss->channels;
     if (ioctl(fd, SNDCTL_DSP_CHANNELS, &channels) < 0) {
-        pa_log(__FILE__": SNDCTL_DSP_CHANNELS: %s", strerror(errno));
+        pa_log(__FILE__": SNDCTL_DSP_CHANNELS: %s", pa_cstrerror(errno));
         return -1;
     }
     assert(channels);
@@ -138,7 +140,7 @@
 
     speed = ss->rate;
     if (ioctl(fd, SNDCTL_DSP_SPEED, &speed) < 0) {
-        pa_log(__FILE__": SNDCTL_DSP_SPEED: %s", strerror(errno));
+        pa_log(__FILE__": SNDCTL_DSP_SPEED: %s", pa_cstrerror(errno));
         return -1;
     }
     assert(speed);
@@ -164,7 +166,7 @@
     arg = ((int) nfrags << 16) | simple_log2(frag_size);
     
     if (ioctl(fd, SNDCTL_DSP_SETFRAGMENT, &arg) < 0) {
-        pa_log(__FILE__": SNDCTL_DSP_SETFRAGMENT: %s", strerror(errno));
+        pa_log(__FILE__": SNDCTL_DSP_SETFRAGMENT: %s", pa_cstrerror(errno));
         return -1;
     }
 
@@ -253,7 +255,7 @@
         !(f = fopen("/proc/asound/oss/sndstat", "r"))) {
 
         if (errno != ENOENT)
-            pa_log_warn(__FILE__": failed to open OSS sndstat device: %s", strerror(errno));
+            pa_log_warn(__FILE__": failed to open OSS sndstat device: %s", pa_cstrerror(errno));
 
         return -1;
     }

Modified: trunk/src/modules/rtp/module-rtp-recv.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/rtp/module-rtp-recv.c?rev=945&root=polypaudio&r1=944&r2=945&view=diff
==============================================================================
--- trunk/src/modules/rtp/module-rtp-recv.c (original)
+++ trunk/src/modules/rtp/module-rtp-recv.c Mon May 22 17:20:46 2006
@@ -31,6 +31,7 @@
 #include <string.h>
 #include <unistd.h>
 
+#include <polyp/error.h>
 #include <polyp/timeval.h>
 #include <polyp/xmalloc.h>
 
@@ -216,13 +217,13 @@
     
     af = sa->sa_family;
     if ((fd = socket(af, SOCK_DGRAM, 0)) < 0) {
-        pa_log(__FILE__": Failed to create socket: %s", strerror(errno));
+        pa_log(__FILE__": Failed to create socket: %s", pa_cstrerror(errno));
         goto fail;
     }
 
     one = 1;
     if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one)) < 0) {
-        pa_log(__FILE__": SO_REUSEADDR failed: %s", strerror(errno));
+        pa_log(__FILE__": SO_REUSEADDR failed: %s", pa_cstrerror(errno));
         goto fail;
     }
     
@@ -239,12 +240,12 @@
     }
 
     if (r < 0) {
-        pa_log_info(__FILE__": Joining mcast group failed: %s", strerror(errno));
+        pa_log_info(__FILE__": Joining mcast group failed: %s", pa_cstrerror(errno));
         goto fail;
     }
     
     if (bind(fd, sa, salen) < 0) {
-        pa_log(__FILE__": bind() failed: %s", strerror(errno));
+        pa_log(__FILE__": bind() failed: %s", pa_cstrerror(errno));
         goto fail;
     }
 

Modified: trunk/src/modules/rtp/module-rtp-send.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/rtp/module-rtp-send.c?rev=945&root=polypaudio&r1=944&r2=945&view=diff
==============================================================================
--- trunk/src/modules/rtp/module-rtp-send.c (original)
+++ trunk/src/modules/rtp/module-rtp-send.c Mon May 22 17:20:46 2006
@@ -32,6 +32,7 @@
 #include <string.h>
 #include <unistd.h>
 
+#include <polyp/error.h>
 #include <polyp/timeval.h>
 #include <polyp/util.h>
 #include <polyp/xmalloc.h>
@@ -238,28 +239,28 @@
     }
     
     if ((fd = socket(af, SOCK_DGRAM, 0)) < 0) {
-        pa_log(__FILE__": socket() failed: %s", strerror(errno));
+        pa_log(__FILE__": socket() failed: %s", pa_cstrerror(errno));
         goto fail;
     }
 
     if (connect(fd, af == AF_INET ? (struct sockaddr*) &sa4 : (struct sockaddr*) &sa6, af == AF_INET ? sizeof(sa4) : sizeof(sa6)) < 0) {
-        pa_log(__FILE__": connect() failed: %s", strerror(errno));
+        pa_log(__FILE__": connect() failed: %s", pa_cstrerror(errno));
         goto fail;
     }
 
     if ((sap_fd = socket(af, SOCK_DGRAM, 0)) < 0) {
-        pa_log(__FILE__": socket() failed: %s", strerror(errno));
+        pa_log(__FILE__": socket() failed: %s", pa_cstrerror(errno));
         goto fail;
     }
 
     if (connect(sap_fd, af == AF_INET ? (struct sockaddr*) &sap_sa4 : (struct sockaddr*) &sap_sa6, af == AF_INET ? sizeof(sap_sa4) : sizeof(sap_sa6)) < 0) {
-        pa_log(__FILE__": connect() failed: %s", strerror(errno));
+        pa_log(__FILE__": connect() failed: %s", pa_cstrerror(errno));
         goto fail;
     }
 
     if (setsockopt(fd, IPPROTO_IP, IP_MULTICAST_LOOP, &loop, sizeof(loop)) < 0 ||
         setsockopt(sap_fd, IPPROTO_IP, IP_MULTICAST_LOOP, &loop, sizeof(loop)) < 0) {
-        pa_log(__FILE__": IP_MULTICAST_LOOP failed: %s", strerror(errno));
+        pa_log(__FILE__": IP_MULTICAST_LOOP failed: %s", pa_cstrerror(errno));
         goto fail;
     }
     

Modified: trunk/src/modules/rtp/rtp.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/rtp/rtp.c?rev=945&root=polypaudio&r1=944&r2=945&view=diff
==============================================================================
--- trunk/src/modules/rtp/rtp.c (original)
+++ trunk/src/modules/rtp/rtp.c Mon May 22 17:20:46 2006
@@ -36,6 +36,8 @@
 #include <sys/filio.h>
 #endif
 
+#include <polyp/error.h>
+
 #include <polypcore/log.h>
 
 #include "rtp.h"
@@ -124,7 +126,7 @@
             
             if (k < 0) {
                 if (errno != EAGAIN) /* If the queue is full, just ignore it */
-                    pa_log(__FILE__": sendmsg() failed: %s", strerror(errno));
+                    pa_log(__FILE__": sendmsg() failed: %s", pa_cstrerror(errno));
                 return -1;
             }
             
@@ -162,7 +164,7 @@
     chunk->memblock = NULL;
 
     if (ioctl(c->fd, FIONREAD, &size) < 0) {
-        pa_log(__FILE__": FIONREAD failed: %s", strerror(errno));
+        pa_log(__FILE__": FIONREAD failed: %s", pa_cstrerror(errno));
         goto fail;
     }
 
@@ -183,7 +185,7 @@
     m.msg_flags = 0;
     
     if ((r = recvmsg(c->fd, &m, 0)) != size) {
-        pa_log(__FILE__": recvmsg() failed: %s", r < 0 ? strerror(errno) : "size mismatch");
+        pa_log(__FILE__": recvmsg() failed: %s", r < 0 ? pa_cstrerror(errno) : "size mismatch");
         goto fail;
     }
 

Modified: trunk/src/modules/rtp/sap.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/rtp/sap.c?rev=945&root=polypaudio&r1=944&r2=945&view=diff
==============================================================================
--- trunk/src/modules/rtp/sap.c (original)
+++ trunk/src/modules/rtp/sap.c Mon May 22 17:20:46 2006
@@ -38,6 +38,7 @@
 #include <sys/filio.h>
 #endif
 
+#include <polyp/error.h>
 #include <polyp/xmalloc.h>
 
 #include <polypcore/core-util.h>
@@ -77,7 +78,7 @@
     int k;
 
     if (getsockname(c->fd, sa, &salen) < 0) {
-        pa_log("getsockname() failed: %s\n", strerror(errno));
+        pa_log("getsockname() failed: %s\n", pa_cstrerror(errno));
         return -1;
     }
 
@@ -109,7 +110,7 @@
     m.msg_flags = 0;
     
     if ((k = sendmsg(c->fd, &m, MSG_DONTWAIT)) < 0)
-        pa_log("sendmsg() failed: %s\n", strerror(errno));
+        pa_log("sendmsg() failed: %s\n", pa_cstrerror(errno));
 
     return k;
 }
@@ -136,7 +137,7 @@
     assert(goodbye);
 
     if (ioctl(c->fd, FIONREAD, &size) < 0) {
-        pa_log(__FILE__": FIONREAD failed: %s", strerror(errno));
+        pa_log(__FILE__": FIONREAD failed: %s", pa_cstrerror(errno));
         goto fail;
     }
 
@@ -158,7 +159,7 @@
     m.msg_flags = 0;
     
     if ((r = recvmsg(c->fd, &m, 0)) != size) {
-        pa_log(__FILE__": recvmsg() failed: %s", r < 0 ? strerror(errno) : "size mismatch");
+        pa_log(__FILE__": recvmsg() failed: %s", r < 0 ? pa_cstrerror(errno) : "size mismatch");
         goto fail;
     }
 

Modified: trunk/src/polyp/client-conf.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/polyp/client-conf.c?rev=945&root=polypaudio&r1=944&r2=945&view=diff
==============================================================================
--- trunk/src/polyp/client-conf.c (original)
+++ trunk/src/polyp/client-conf.c Mon May 22 17:20:46 2006
@@ -29,6 +29,7 @@
 #include <errno.h>
 #include <string.h>
 
+#include <polyp/error.h>
 #include <polyp/xmalloc.h>
 
 #include <polypcore/log.h>
@@ -123,7 +124,7 @@
         pa_open_config_file(DEFAULT_CLIENT_CONFIG_FILE, DEFAULT_CLIENT_CONFIG_FILE_USER, ENV_CLIENT_CONFIG_FILE, &fn, "r");
 
     if (!f && errno != EINTR) {
-        pa_log(__FILE__": WARNING: failed to open configuration file '%s': %s", filename, strerror(errno));
+        pa_log(__FILE__": WARNING: failed to open configuration file '%s': %s", filename, pa_cstrerror(errno));
         goto finish;
     }
     

Modified: trunk/src/polyp/context.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/polyp/context.c?rev=945&root=polypaudio&r1=944&r2=945&view=diff
==============================================================================
--- trunk/src/polyp/context.c (original)
+++ trunk/src/polyp/context.c Mon May 22 17:20:46 2006
@@ -47,6 +47,7 @@
 
 #include "../polypcore/winsock.h"
 
+#include <polyp/error.h>
 #include <polyp/version.h>
 #include <polyp/xmalloc.h>
 
@@ -440,7 +441,7 @@
     pa_context_ref(c);
     
     if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds) < 0) {
-        pa_log(__FILE__": socketpair() failed: %s", strerror(errno));
+        pa_log(__FILE__": socketpair(): %s", pa_cstrerror(errno));
         pa_context_fail(c, PA_ERR_INTERNAL);
         goto fail;
     }
@@ -454,7 +455,7 @@
         c->spawn_api.prefork();
 
     if ((pid = fork()) < 0) {
-        pa_log(__FILE__": fork() failed: %s", strerror(errno));
+        pa_log(__FILE__": fork(): %s", pa_cstrerror(errno));
         pa_context_fail(c, PA_ERR_INTERNAL);
 
         if (c->spawn_api.postfork)
@@ -510,7 +511,7 @@
         c->spawn_api.postfork();
         
     if (r < 0) {
-        pa_log(__FILE__": waitpid() failed: %s", strerror(errno));
+        pa_log(__FILE__": waitpid(): %s", pa_cstrerror(errno));
         pa_context_fail(c, PA_ERR_INTERNAL);
         goto fail;
     } else if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) {

Modified: trunk/src/polyp/error.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/polyp/error.c?rev=945&root=polypaudio&r1=944&r2=945&view=diff
==============================================================================
--- trunk/src/polyp/error.c (original)
+++ trunk/src/polyp/error.c Mon May 22 17:20:46 2006
@@ -23,9 +23,23 @@
 #include <config.h>
 #endif
 
+#include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 
+#ifdef HAVE_PTHREAD
+#include <pthread.h>
+#endif
+
+#ifdef HAVE_WINDOWS_H
+#include <windows.h>
+#endif
+
+#include <polyp/utf8.h>
+#include <polyp/xmalloc.h>
+
+#include <polypcore/core-util.h>
 #include <polypcore/native-common.h>
 
 #include "error.h"
@@ -58,3 +72,79 @@
 
     return errortab[error];
 }
+
+#ifdef HAVE_PTHREAD
+
+static pthread_once_t cstrerror_once = PTHREAD_ONCE_INIT;
+static pthread_key_t tlsstr_key;
+
+static void inittls(void) {
+    int ret;
+
+    ret = pthread_key_create(&tlsstr_key, pa_xfree);
+    if (ret) {
+        fprintf(stderr, __FILE__ ": CRITICAL: Unable to allocate TLS key (%d)\n", errno);
+        exit(-1);
+    }
+}
+
+#elif HAVE_WINDOWS_H
+
+static __declspec(thread) char *tlsstr;
+
+#else
+
+/* Unsafe, but we have no choice */
+static char *tlsstr;
+
+#endif
+
+char* pa_cstrerror(int errnum) {
+    const char *origbuf;
+
+#ifdef HAVE_STRERROR_R
+    char errbuf[128];
+#endif
+
+#ifdef HAVE_PTHREAD
+    char *tlsstr;
+
+    pthread_once(&cstrerror_once, inittls);
+
+    tlsstr = pthread_getspecific(tlsstr_key);
+#endif
+
+    if (tlsstr)
+        pa_xfree(tlsstr);
+
+#ifdef HAVE_STRERROR_R
+
+#ifdef __GLIBC__
+    origbuf = strerror_r(errnum, errbuf, sizeof(errbuf));
+    if (origbuf == NULL)
+        origbuf = "";
+#else
+    if (strerror_r(errnum, errbuf, sizeof(errbuf)) == 0) {
+        origbuf = errbuf;
+        errbuf[sizeof(errbuf) - 1] = '\0';
+    } else
+        origbuf = "";
+#endif
+
+#else
+    /* This might not be thread safe, but we hope for the best */
+    origbuf = strerror(errnum);
+#endif
+
+    tlsstr = pa_locale_to_utf8(origbuf);
+    if (!tlsstr) {
+        fprintf(stderr, "Unable to convert, filtering\n");
+        tlsstr = pa_utf8_filter(origbuf);
+    }
+
+#ifdef HAVE_PTHREAD
+    pthread_setspecific(tlsstr_key, tlsstr);
+#endif
+
+    return tlsstr;
+}

Modified: trunk/src/polyp/error.h
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/polyp/error.h?rev=945&root=polypaudio&r1=944&r2=945&view=diff
==============================================================================
--- trunk/src/polyp/error.h (original)
+++ trunk/src/polyp/error.h Mon May 22 17:20:46 2006
@@ -33,6 +33,12 @@
 /** Return a human readable error message for the specified numeric error code */
 const char* pa_strerror(int error);
 
+/** A wrapper around the standard strerror() function that converts the
+ * string to UTF-8. The function is thread safe but the returned string is
+ * only guaranteed to exist until the thread exits or pa_cstrerror() is
+ * called again from the same thread. */
+char* pa_cstrerror(int errnum);
+
 PA_C_DECL_END
 
 #endif

Modified: trunk/src/polyp/mainloop-signal.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/polyp/mainloop-signal.c?rev=945&root=polypaudio&r1=944&r2=945&view=diff
==============================================================================
--- trunk/src/polyp/mainloop-signal.c (original)
+++ trunk/src/polyp/mainloop-signal.c Mon May 22 17:20:46 2006
@@ -36,6 +36,7 @@
 #include <windows.h>
 #endif
 
+#include <polyp/error.h>
 #include <polyp/xmalloc.h>
 
 #include <polypcore/core-util.h>
@@ -89,7 +90,7 @@
         if (errno == EAGAIN)
             return;
 
-        pa_log(__FILE__": read(): %s", strerror(errno));
+        pa_log(__FILE__": read(): %s", pa_cstrerror(errno));
         return;
     }
     
@@ -106,7 +107,7 @@
     assert(!api && a && signal_pipe[0] == -1 && signal_pipe[1] == -1 && !io_event);
 
     if (pipe(signal_pipe) < 0) {
-        pa_log(__FILE__": pipe() failed: %s", strerror(errno));
+        pa_log(__FILE__": pipe(): %s", pa_cstrerror(errno));
         return -1;
     }
 

Modified: trunk/src/polyp/mainloop.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/polyp/mainloop.c?rev=945&root=polypaudio&r1=944&r2=945&view=diff
==============================================================================
--- trunk/src/polyp/mainloop.c (original)
+++ trunk/src/polyp/mainloop.c Mon May 22 17:20:46 2006
@@ -44,6 +44,7 @@
 #include "../polypcore/pipe.h"
 #endif
 
+#include <polyp/error.h>
 #include <polyp/timeval.h>
 #include <polyp/xmalloc.h>
 
@@ -689,7 +690,7 @@
             if (errno == EINTR)
                 r = 0;
             else
-                pa_log(__FILE__": poll(): %s", strerror(errno));
+                pa_log(__FILE__": poll(): %s", pa_cstrerror(errno));
         }
     }
 

Modified: trunk/src/polyp/util.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/polyp/util.c?rev=945&root=polypaudio&r1=944&r2=945&view=diff
==============================================================================
--- trunk/src/polyp/util.c (original)
+++ trunk/src/polyp/util.c Mon May 22 17:20:46 2006
@@ -51,6 +51,8 @@
 
 #include "../polypcore/winsock.h"
 
+#include <polyp/error.h>
+
 #include <polypcore/log.h>
 #include <polypcore/core-util.h>
 
@@ -107,7 +109,7 @@
 char *pa_get_host_name(char *s, size_t l) {
     assert(s && l > 0);
     if (gethostname(s, l) < 0) {
-        pa_log(__FILE__": gethostname(): %s", strerror(errno));
+        pa_log(__FILE__": gethostname(): %s", pa_cstrerror(errno));
         return NULL;
     }
     s[l-1] = 0;

Modified: trunk/src/polypcore/authkey.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/polypcore/authkey.c?rev=945&root=polypaudio&r1=944&r2=945&view=diff
==============================================================================
--- trunk/src/polypcore/authkey.c (original)
+++ trunk/src/polypcore/authkey.c Mon May 22 17:20:46 2006
@@ -35,6 +35,7 @@
 #include <limits.h>
 #include <sys/stat.h>
 
+#include <polyp/error.h>
 #include <polyp/util.h>
 #include <polypcore/core-util.h>
 #include <polypcore/log.h>
@@ -53,7 +54,7 @@
     ftruncate(fd, 0);
 
     if ((r = pa_loop_write(fd, ret_data, length)) < 0 || (size_t) r != length) {
-        pa_log(__FILE__": failed to write cookie file: %s", strerror(errno));
+        pa_log(__FILE__": failed to write cookie file: %s", pa_cstrerror(errno));
         return -1;
     }
 
@@ -75,7 +76,7 @@
 
     if ((fd = open(fn, O_RDWR|O_CREAT|O_BINARY, S_IRUSR|S_IWUSR)) < 0) {
         if (errno != EACCES || (fd = open(fn, O_RDONLY|O_BINARY)) < 0) {
-            pa_log(__FILE__": failed to open cookie file '%s': %s", fn, strerror(errno));
+            pa_log(__FILE__": failed to open cookie file '%s': %s", fn, pa_cstrerror(errno));
             goto finish;
         } else
             writable = 0;
@@ -84,7 +85,7 @@
     unlock = pa_lock_fd(fd, 1) >= 0;
 
     if ((r = pa_loop_read(fd, data, length)) < 0) {
-        pa_log(__FILE__": failed to read cookie file '%s': %s", fn, strerror(errno));
+        pa_log(__FILE__": failed to read cookie file '%s': %s", fn, pa_cstrerror(errno));
         goto finish;
     }
 
@@ -125,7 +126,7 @@
 
     if (ret < 0)
         pa_log(__FILE__": Failed to load authorization key '%s': %s", path,
-               (ret == -1) ? strerror(errno) : "file corrupt");
+               (ret == -1) ? pa_cstrerror(errno) : "file corrupt");
 
     return ret;
 }
@@ -181,14 +182,14 @@
         return -2;
 
     if ((fd = open(p, O_RDWR|O_CREAT, S_IRUSR|S_IWUSR)) < 0) {
-        pa_log(__FILE__": failed to open cookie file '%s': %s", fn, strerror(errno));
+        pa_log(__FILE__": failed to open cookie file '%s': %s", fn, pa_cstrerror(errno));
         goto finish;
     }
 
     unlock = pa_lock_fd(fd, 1) >= 0;
 
     if ((r = pa_loop_write(fd, data, length)) < 0 || (size_t) r != length) {
-        pa_log(__FILE__": failed to read cookie file '%s': %s", fn, strerror(errno));
+        pa_log(__FILE__": failed to read cookie file '%s': %s", fn, pa_cstrerror(errno));
         goto finish;
     }
 

Modified: trunk/src/polypcore/cli-command.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/polypcore/cli-command.c?rev=945&root=polypaudio&r1=944&r2=945&view=diff
==============================================================================
--- trunk/src/polypcore/cli-command.c (original)
+++ trunk/src/polypcore/cli-command.c Mon May 22 17:20:46 2006
@@ -29,6 +29,7 @@
 #include <stdlib.h>
 #include <errno.h>
 
+#include <polyp/error.h>
 #include <polyp/xmalloc.h>
 
 #include <polypcore/module.h>
@@ -900,7 +901,7 @@
     assert(c && fn && buf);
 
     if (!(f = fopen(fn, "r"))) {
-        pa_strbuf_printf(buf, "open('%s') failed: %s\n", fn, strerror(errno));
+        pa_strbuf_printf(buf, "open('%s') failed: %s\n", fn, pa_cstrerror(errno));
         if (!*fail)
             ret = 0;
         goto fail;

Modified: trunk/src/polypcore/conf-parser.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/polypcore/conf-parser.c?rev=945&root=polypaudio&r1=944&r2=945&view=diff
==============================================================================
--- trunk/src/polypcore/conf-parser.c (original)
+++ trunk/src/polypcore/conf-parser.c Mon May 22 17:20:46 2006
@@ -28,6 +28,7 @@
 #include <stdio.h>
 #include <errno.h>
 
+#include <polyp/error.h>
 #include <polyp/xmalloc.h>
 
 #include <polypcore/log.h>
@@ -112,7 +113,8 @@
             goto finish;
         }
         
-        pa_log(__FILE__": WARNING: failed to open configuration file '%s': %s", filename, strerror(errno));
+        pa_log_warn(__FILE__": WARNING: failed to open configuration file '%s': %s",
+            filename, pa_cstrerror(errno));
         goto finish;
     }
 
@@ -122,7 +124,8 @@
             if (feof(f))
                 break;
             
-            pa_log(__FILE__": WARNING: failed to read configuration file '%s': %s", filename, strerror(errno));
+            pa_log_warn(__FILE__": WARNING: failed to read configuration file '%s': %s",
+                filename, pa_cstrerror(errno));
             goto finish;
         }
             

Modified: trunk/src/polypcore/core-scache.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/polypcore/core-scache.c?rev=945&root=polypaudio&r1=944&r2=945&view=diff
==============================================================================
--- trunk/src/polypcore/core-scache.c (original)
+++ trunk/src/polypcore/core-scache.c Mon May 22 17:20:46 2006
@@ -41,6 +41,7 @@
 #include <windows.h>
 #endif
 
+#include <polyp/error.h>
 #include <polyp/mainloop.h>
 #include <polyp/channelmap.h>
 #include <polyp/timeval.h>
@@ -359,7 +360,7 @@
     e = pa_path_get_filename(pathname);
     
     if (stat(pathname, &st) < 0) {
-        pa_log(__FILE__": stat('%s') failed: %s", pathname, strerror(errno));
+        pa_log(__FILE__": stat('%s'): %s", pathname, pa_cstrerror(errno));
         return;
     }
 
@@ -381,7 +382,7 @@
         /* If that fails, try to open it as shell glob */
 
         if (glob(pathname, GLOB_ERR|GLOB_NOSORT, NULL, &p) < 0) {
-            pa_log(__FILE__": Failed to open directory: %s", strerror(errno));
+            pa_log(__FILE__": failed to open directory '%s': %s", pathname, pa_cstrerror(errno));
             return -1;
         }
 

Modified: trunk/src/polypcore/core-util.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/polypcore/core-util.c?rev=945&root=polypaudio&r1=944&r2=945&view=diff
==============================================================================
--- trunk/src/polypcore/core-util.c (original)
+++ trunk/src/polypcore/core-util.c Mon May 22 17:20:46 2006
@@ -69,6 +69,7 @@
 
 #include <samplerate.h>
 
+#include <polyp/error.h>
 #include <polyp/xmalloc.h>
 #include <polyp/util.h>
 
@@ -301,7 +302,7 @@
     if (pthread_sigmask(SIG_SETMASK, NULL, &set) < 0) {
 #endif
         if (sigprocmask(SIG_SETMASK, NULL, &set) < 0) {
-            pa_log(__FILE__": sigprocmask() failed: %s", strerror(errno));
+            pa_log(__FILE__": sigprocmask(): %s", pa_cstrerror(errno));
             return;
         }
 #ifdef HAVE_PTHREAD
@@ -314,7 +315,7 @@
     /* Check whether the signal is trapped */
     
     if (sigaction(sig, NULL, &sa) < 0) {
-        pa_log(__FILE__": sigaction() failed: %s", strerror(errno));
+        pa_log(__FILE__": sigaction(): %s", pa_cstrerror(errno));
         return;
     }
         
@@ -396,7 +397,7 @@
 
 #ifdef HAVE_SYS_RESOURCE_H
     if (setpriority(PRIO_PROCESS, 0, NICE_LEVEL) < 0)
-        pa_log_warn(__FILE__": setpriority() failed: %s", strerror(errno));
+        pa_log_warn(__FILE__": setpriority(): %s", pa_cstrerror(errno));
     else 
         pa_log_info(__FILE__": Successfully gained nice level %i.", NICE_LEVEL); 
 #endif
@@ -406,13 +407,13 @@
         struct sched_param sp;
 
         if (sched_getparam(0, &sp) < 0) {
-            pa_log(__FILE__": sched_getparam() failed: %s", strerror(errno));
+            pa_log(__FILE__": sched_getparam(): %s", pa_cstrerror(errno));
             return;
         }
         
         sp.sched_priority = 1;
         if (sched_setscheduler(0, SCHED_FIFO, &sp) < 0) {
-            pa_log_warn(__FILE__": sched_setscheduler() failed: %s", strerror(errno));
+            pa_log_warn(__FILE__": sched_setscheduler(): %s", pa_cstrerror(errno));
             return;
         }
 
@@ -563,7 +564,7 @@
     data = pa_xmalloc(n);
 
     if (getgrgid_r(gid, &group, data, n, &result) < 0 || !result) {
-        pa_log(__FILE__ ": getgrgid_r(%u) failed: %s", gid, strerror(errno));
+        pa_log(__FILE__": getgrgid_r(%u): %s", gid, pa_cstrerror(errno));
         goto finish;
     }
 
@@ -575,8 +576,8 @@
     /* XXX Not thread-safe, but needed on OSes (e.g. FreeBSD 4.X) that do not
      * support getgrgid_r. */
     if ((result = getgrgid(gid)) == NULL) {
-	pa_log(__FILE__ ": getgrgid(%u) failed: %s", gid, strerror(errno));
-	goto finish;
+        pa_log(__FILE__": getgrgid(%u): %s", gid, pa_cstrerror(errno));
+        goto finish;
     }
 
     r = strcmp(name, result->gr_name) == 0;
@@ -598,7 +599,7 @@
     gids = pa_xmalloc(sizeof(GETGROUPS_T)*n);
     
     if ((n = getgroups(n, gids)) < 0) {
-        pa_log(__FILE__": getgroups() failed: %s", strerror(errno));
+        pa_log(__FILE__": getgroups(): %s", pa_cstrerror(errno));
         goto finish;
     }
 
@@ -696,7 +697,8 @@
             return 0;
     }
         
-    pa_log(__FILE__": %slock failed: %s", !b ? "un" : "", strerror(errno));
+    pa_log(__FILE__": %slock: %s", !b? "un" : "",
+        pa_cstrerror(errno));
 #endif
 
 #ifdef OS_IS_WIN32
@@ -730,7 +732,8 @@
         struct stat st;
         
         if ((fd = open(fn, O_CREAT|O_RDWR, S_IRUSR|S_IWUSR)) < 0) {
-            pa_log(__FILE__": failed to create lock file '%s': %s", fn, strerror(errno));
+            pa_log(__FILE__": failed to create lock file '%s': %s", fn,
+                pa_cstrerror(errno));
             goto fail;
         }
         
@@ -777,7 +780,8 @@
     assert(fn && fd >= 0);
 
     if (unlink(fn) < 0) {
-        pa_log_warn(__FILE__": WARNING: unable to remove lock file '%s': %s", fn, strerror(errno));
+        pa_log_warn(__FILE__": WARNING: unable to remove lock file '%s': %s",
+            fn, pa_cstrerror(errno));
         r = -1;
     }
     
@@ -787,7 +791,8 @@
     }
 
     if (close(fd) < 0) {
-        pa_log_warn(__FILE__": WARNING: failed to close lock file '%s': %s", fn, strerror(errno));
+        pa_log_warn(__FILE__": WARNING: failed to close lock file '%s': %s",
+            fn, pa_cstrerror(errno));
         r = -1;
     }
 

Modified: trunk/src/polypcore/iochannel.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/polypcore/iochannel.c?rev=945&root=polypaudio&r1=944&r2=945&view=diff
==============================================================================
--- trunk/src/polypcore/iochannel.c (original)
+++ trunk/src/polypcore/iochannel.c Mon May 22 17:20:46 2006
@@ -38,6 +38,7 @@
 
 #include "winsock.h"
 
+#include <polyp/error.h>
 #include <polyp/xmalloc.h>
 
 #include <polypcore/core-util.h>
@@ -253,7 +254,7 @@
     assert(io->ifd >= 0);
     
     if (setsockopt(io->ifd, SOL_SOCKET, SO_PASSCRED, &t, sizeof(t)) < 0) {
-        pa_log_error("setsockopt(SOL_SOCKET, SO_PASSCRED): %s", strerror(errno));
+        pa_log_error("setsockopt(SOL_SOCKET, SO_PASSCRED): %s", pa_cstrerror(errno));
         return -1;
     }
 

Modified: trunk/src/polypcore/ioline.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/polypcore/ioline.c?rev=945&root=polypaudio&r1=944&r2=945&view=diff
==============================================================================
--- trunk/src/polypcore/ioline.c (original)
+++ trunk/src/polypcore/ioline.c Mon May 22 17:20:46 2006
@@ -29,6 +29,7 @@
 #include <stdlib.h>
 #include <string.h>
 
+#include <polyp/error.h>
 #include <polyp/xmalloc.h>
 
 #include <polypcore/log.h>
@@ -275,7 +276,7 @@
             pa_ioline_puts(l, "\nExiting.\n");
             do_write(l);
         } else if (r < 0) {
-            pa_log(__FILE__": read() failed: %s", strerror(errno));
+            pa_log(__FILE__": read(): %s", pa_cstrerror(errno));
             failure(l);
             return -1;
         }
@@ -297,7 +298,7 @@
     while (!l->dead && pa_iochannel_is_writable(l->io) && l->wbuf_valid_length) {
         
         if ((r = pa_iochannel_write(l->io, l->wbuf+l->wbuf_index, l->wbuf_valid_length)) < 0) {
-            pa_log(__FILE__": write() failed: %s", r < 0 ? strerror(errno) : "EOF");
+            pa_log(__FILE__": write(): %s", r < 0 ? pa_cstrerror(errno) : "EOF");
             failure(l);
             return -1;
         }

Modified: trunk/src/polypcore/log.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/polypcore/log.c?rev=945&root=polypaudio&r1=944&r2=945&view=diff
==============================================================================
--- trunk/src/polypcore/log.c (original)
+++ trunk/src/polypcore/log.c Mon May 22 17:20:46 2006
@@ -94,6 +94,9 @@
 
     text = pa_vsprintf_malloc(format, ap);
 
+    if (!pa_utf8_valid(text))
+        pa_log_level(level, __FILE__": invalid UTF-8 string following below:");
+
     for (t = text; t; t = n) {
         if ((n = strchr(t, '\n'))) {
             *n = 0;

Modified: trunk/src/polypcore/pid.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/polypcore/pid.c?rev=945&root=polypaudio&r1=944&r2=945&view=diff
==============================================================================
--- trunk/src/polypcore/pid.c (original)
+++ trunk/src/polypcore/pid.c Mon May 22 17:20:46 2006
@@ -39,6 +39,7 @@
 #include <windows.h>
 #endif
 
+#include <polyp/error.h>
 #include <polyp/xmalloc.h>
 
 #include <polypcore/core-util.h>
@@ -56,7 +57,8 @@
     assert(fn && fd >= 0);
 
     if ((r = pa_loop_read(fd, t, sizeof(t)-1)) < 0) {
-        pa_log(__FILE__": WARNING: failed to read PID file '%s': %s", fn, strerror(errno));
+        pa_log_warn(__FILE__": WARNING: failed to read PID file '%s': %s",
+            fn, pa_cstrerror(errno));
         return (pid_t) -1;
     }
 
@@ -86,7 +88,8 @@
         
         if ((fd = open(fn, mode, S_IRUSR|S_IWUSR)) < 0) {
             if (mode != O_RDONLY || errno != ENOENT)
-                pa_log(__FILE__": WARNING: failed to open PID file '%s': %s", fn, strerror(errno));
+                pa_log_warn(__FILE__": WARNING: failed to open PID file '%s': %s",
+                    fn, pa_cstrerror(errno));
             goto fail;
         }
 
@@ -95,7 +98,8 @@
             goto fail;
         
         if (fstat(fd, &st) < 0) {
-            pa_log(__FILE__": Failed to fstat() PID file '%s': %s", fn, strerror(errno));
+            pa_log_warn(__FILE__": WARNING: failed to fstat() PID file '%s': %s",
+                fn, pa_cstrerror(errno));
             goto fail;
         }
 
@@ -107,7 +111,8 @@
             goto fail;
 
         if (close(fd) < 0) {
-            pa_log(__FILE__": Failed to close file '%s': %s", fn, strerror(errno));
+            pa_log_warn(__FILE__": WARNING: failed to close file '%s': %s",
+                fn, pa_cstrerror(errno));
             goto fail;
         }
 
@@ -164,7 +169,8 @@
 
     /* Overwrite the current PID file */
     if (lseek(fd, 0, SEEK_SET) == (off_t) -1 || ftruncate(fd, 0) < 0) {
-        pa_log(__FILE__": failed to truncate PID fil: %s.", strerror(errno));
+        pa_log(__FILE__": failed to truncate PID file '%s': %s",
+            fn, pa_cstrerror(errno));
         goto fail;
     }
     
@@ -198,7 +204,8 @@
     pa_runtime_path("pid", fn, sizeof(fn));
 
     if ((fd = open_pid_file(fn, O_RDWR)) < 0) {
-        pa_log(__FILE__": WARNING: failed to open PID file '%s': %s", fn, strerror(errno));
+        pa_log_warn(__FILE__": WARNING: failed to open PID file '%s': %s",
+            fn, pa_cstrerror(errno));
         goto fail;
     }
 
@@ -211,7 +218,8 @@
     }
 
     if (ftruncate(fd, 0) < 0) {
-        pa_log(__FILE__": failed to truncate PID file '%s': %s", fn, strerror(errno));
+        pa_log_warn(__FILE__": WARNING: failed to truncate PID file '%s': %s",
+            fn, pa_cstrerror(errno));
         goto fail;
     }
 
@@ -222,7 +230,8 @@
 #endif
 
     if (unlink(fn) < 0) {
-        pa_log(__FILE__": failed to remove PID file '%s': %s", fn, strerror(errno));
+        pa_log_warn(__FILE__": WARNING: failed to remove PID file '%s': %s",
+            fn, pa_cstrerror(errno));
         goto fail;
     }
 

Modified: trunk/src/polypcore/protocol-esound.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/polypcore/protocol-esound.c?rev=945&root=polypaudio&r1=944&r2=945&view=diff
==============================================================================
--- trunk/src/polypcore/protocol-esound.c (original)
+++ trunk/src/polypcore/protocol-esound.c Mon May 22 17:20:46 2006
@@ -30,6 +30,7 @@
 #include <stdlib.h>
 #include <limits.h>
 
+#include <polyp/error.h>
 #include <polyp/sample.h>
 #include <polyp/timeval.h>
 #include <polyp/utf8.h>
@@ -812,7 +813,7 @@
         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;
         }
 
@@ -860,7 +861,7 @@
         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;
         }
 
@@ -880,7 +881,7 @@
         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;
         }
 
@@ -935,7 +936,7 @@
         }
 
         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;
         }
         
@@ -965,7 +966,7 @@
         
         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;
         }
         
@@ -984,7 +985,7 @@
         
         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;
         }
 

Modified: trunk/src/polypcore/protocol-simple.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/polypcore/protocol-simple.c?rev=945&root=polypaudio&r1=944&r2=945&view=diff
==============================================================================
--- trunk/src/polypcore/protocol-simple.c (original)
+++ trunk/src/polypcore/protocol-simple.c Mon May 22 17:20:46 2006
@@ -30,6 +30,7 @@
 #include <errno.h>
 #include <string.h>
 
+#include <polyp/error.h>
 #include <polyp/xmalloc.h>
 
 #include <polypcore/sink-input.h>
@@ -133,7 +134,7 @@
     }
     
     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 ? "EOF" : strerror(errno));
+        pa_log_debug(__FILE__": read(): %s", r == 0 ? "EOF" : pa_cstrerror(errno));
         return -1;
     }
 
@@ -167,7 +168,7 @@
     
     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;
     }
     

Modified: trunk/src/polypcore/socket-client.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/polypcore/socket-client.c?rev=945&root=polypaudio&r1=944&r2=945&view=diff
==============================================================================
--- trunk/src/polypcore/socket-client.c (original)
+++ trunk/src/polypcore/socket-client.c Mon May 22 17:20:46 2006
@@ -54,6 +54,7 @@
 
 #include "winsock.h"
 
+#include <polyp/error.h>
 #include <polyp/timeval.h>
 #include <polyp/xmalloc.h>
 
@@ -139,7 +140,7 @@
     
     lerror = sizeof(error);
     if (getsockopt(c->fd, SOL_SOCKET, SO_ERROR, (void*)&error, &lerror) < 0) {
-        pa_log(__FILE__": getsockopt(): %s", strerror(errno));
+        pa_log(__FILE__": getsockopt(): %s", pa_cstrerror(errno));
         goto finish;
     }
 
@@ -149,7 +150,7 @@
     }
 
     if (error != 0) {
-        pa_log_debug(__FILE__": connect(): %s", strerror(error)); 
+        pa_log_debug(__FILE__": connect(): %s", pa_cstrerror(errno));
         errno = error;
         goto finish;
     }
@@ -194,7 +195,7 @@
             pa_log_debug(__FILE__": connect(): %d", WSAGetLastError());
 #else
         if (errno != EINPROGRESS) {
-            pa_log_debug(__FILE__": connect(): %s (%d)", strerror(errno), errno);
+            pa_log_debug(__FILE__": connect(): %s (%d)", pa_cstrerror(errno), errno);
 #endif
             return -1;
         }
@@ -266,7 +267,7 @@
     }
     
     if ((c->fd = socket(sa->sa_family, SOCK_STREAM, 0)) < 0) {
-        pa_log(__FILE__": socket(): %s", strerror(errno));
+        pa_log(__FILE__": socket(): %s", pa_cstrerror(errno));
         return -1;
     }
 

Modified: trunk/src/polypcore/socket-server.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/polypcore/socket-server.c?rev=945&root=polypaudio&r1=944&r2=945&view=diff
==============================================================================
--- trunk/src/polypcore/socket-server.c (original)
+++ trunk/src/polypcore/socket-server.c Mon May 22 17:20:46 2006
@@ -64,6 +64,7 @@
 
 #include <polyp/xmalloc.h>
 #include <polyp/util.h>
+#include <polyp/error.h>
 
 #include <polypcore/socket-util.h>
 #include <polypcore/core-util.h>
@@ -94,7 +95,7 @@
     pa_socket_server_ref(s);
     
     if ((nfd = accept(fd, NULL, NULL)) < 0) {
-        pa_log(__FILE__": accept(): %s", strerror(errno));
+        pa_log(__FILE__": accept(): %s", pa_cstrerror(errno));
         goto finish;
     }
 
@@ -173,7 +174,7 @@
     assert(m && filename);
 
     if ((fd = socket(PF_UNIX, SOCK_STREAM, 0)) < 0) {
-        pa_log(__FILE__": socket(): %s", strerror(errno));
+        pa_log(__FILE__": socket(): %s", pa_cstrerror(errno));
         goto fail;
     }
 
@@ -186,12 +187,12 @@
     pa_socket_low_delay(fd);
     
     if (bind(fd, (struct sockaddr*) &sa, SUN_LEN(&sa)) < 0) {
-        pa_log(__FILE__": bind(): %s", strerror(errno));
+        pa_log(__FILE__": bind(): %s", pa_cstrerror(errno));
         goto fail;
     }
 
     if (listen(fd, 5) < 0) {
-        pa_log(__FILE__": listen(): %s", strerror(errno));
+        pa_log(__FILE__": listen(): %s", pa_cstrerror(errno));
         goto fail;
     }
 
@@ -227,7 +228,7 @@
     assert(m && port);
 
     if ((fd = socket(PF_INET, SOCK_STREAM, 0)) < 0) {
-        pa_log(__FILE__": socket(PF_INET): %s", strerror(errno));
+        pa_log(__FILE__": socket(PF_INET): %s", pa_cstrerror(errno));
         goto fail;
     }
 
@@ -235,7 +236,7 @@
 
 #ifdef SO_REUSEADDR
     if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)) < 0)
-        pa_log(__FILE__": setsockopt(): %s", strerror(errno));
+        pa_log(__FILE__": setsockopt(): %s", pa_cstrerror(errno));
 #endif
 
     pa_socket_tcp_low_delay(fd);
@@ -246,12 +247,12 @@
     sa.sin_addr.s_addr = htonl(address);
 
     if (bind(fd, (struct sockaddr *) &sa, sizeof(sa)) < 0) {
-        pa_log(__FILE__": bind(): %s", strerror(errno));
+        pa_log(__FILE__": bind(): %s", pa_cstrerror(errno));
         goto fail;
     }
 
     if (listen(fd, 5) < 0) {
-        pa_log(__FILE__": listen(): %s", strerror(errno));
+        pa_log(__FILE__": listen(): %s", pa_cstrerror(errno));
         goto fail;
     }
 
@@ -278,7 +279,7 @@
     assert(m && port);
 
     if ((fd = socket(PF_INET6, SOCK_STREAM, 0)) < 0) {
-        pa_log(__FILE__": socket(PF_INET6): %s", strerror(errno));
+        pa_log(__FILE__": socket(PF_INET6): %s", pa_cstrerror(errno));
         goto fail;
     }
 
@@ -286,12 +287,12 @@
 
 #ifdef IPV6_V6ONLY
     if (setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &on, sizeof(on)) < 0)
-        pa_log(__FILE__": setsockopt(IPPROTO_IPV6, IPV6_V6ONLY): %s", strerror(errno));
+        pa_log(__FILE__": setsockopt(IPPROTO_IPV6, IPV6_V6ONLY): %s", pa_cstrerror(errno));
 #endif
 
 #ifdef SO_REUSEADDR
     if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)) < 0)
-        pa_log(__FILE__": setsockopt(SOL_SOCKET, SO_REUSEADDR, 1): %s", strerror(errno));
+        pa_log(__FILE__": setsockopt(SOL_SOCKET, SO_REUSEADDR, 1): %s", pa_cstrerror(errno));
 #endif
 
     pa_socket_tcp_low_delay(fd);
@@ -302,12 +303,12 @@
     memcpy(sa.sin6_addr.s6_addr, address, 16);
 
     if (bind(fd, (struct sockaddr *) &sa, sizeof(sa)) < 0) {
-        pa_log(__FILE__": bind(): %s", strerror(errno));
+        pa_log(__FILE__": bind(): %s", pa_cstrerror(errno));
         goto fail;
     }
 
     if (listen(fd, 5) < 0) {
-        pa_log(__FILE__": listen(): %s", strerror(errno));
+        pa_log(__FILE__": listen(): %s", pa_cstrerror(errno));
         goto fail;
     }
 
@@ -418,7 +419,7 @@
             socklen_t sa_len = sizeof(sa);
 
             if (getsockname(s->fd, (struct sockaddr*) &sa, &sa_len) < 0) {
-                pa_log(__FILE__": getsockname() failed: %s", strerror(errno));
+                pa_log(__FILE__": getsockname(): %s", pa_cstrerror(errno));
                 return NULL;
             }
 
@@ -439,7 +440,7 @@
                 char ip[INET6_ADDRSTRLEN];
                 
                 if (!inet_ntop(AF_INET6, &sa.sin6_addr, ip, sizeof(ip))) {
-                    pa_log(__FILE__": inet_ntop() failed: %s", strerror(errno));
+                    pa_log(__FILE__": inet_ntop(): %s", pa_cstrerror(errno));
                     return NULL;
                 }
                 
@@ -454,7 +455,7 @@
             socklen_t sa_len = sizeof(sa);
 
             if (getsockname(s->fd, (struct sockaddr*) &sa, &sa_len) < 0) {
-                pa_log(__FILE__": getsockname() failed: %s", strerror(errno));
+                pa_log(__FILE__": getsockname(): %s", pa_cstrerror(errno));
                 return NULL;
             }
 
@@ -474,7 +475,7 @@
                 char ip[INET_ADDRSTRLEN];
 
                 if (!inet_ntop(AF_INET, &sa.sin_addr, ip, sizeof(ip))) {
-                    pa_log(__FILE__": inet_ntop() failed: %s", strerror(errno));
+                    pa_log(__FILE__": inet_ntop(): %s", pa_cstrerror(errno));
                     return NULL;
                 }
                 

Modified: trunk/src/polypcore/socket-util.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/polypcore/socket-util.c?rev=945&root=polypaudio&r1=944&r2=945&view=diff
==============================================================================
--- trunk/src/polypcore/socket-util.c (original)
+++ trunk/src/polypcore/socket-util.c Mon May 22 17:20:46 2006
@@ -59,6 +59,7 @@
 
 #include "winsock.h"
 
+#include <polyp/error.h>
 #include <polyp/xmalloc.h>
 
 #include <polypcore/core-util.h>
@@ -198,7 +199,7 @@
     int fd = -1, ret = -1;
 
     if ((fd = socket(PF_UNIX, SOCK_STREAM, 0)) < 0) {
-        pa_log(__FILE__": socket(): %s", strerror(errno));
+        pa_log(__FILE__": socket(): %s", pa_cstrerror(errno));
         goto finish;
     }
 

Modified: trunk/src/utils/pacmd.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/utils/pacmd.c?rev=945&root=polypaudio&r1=944&r2=945&view=diff
==============================================================================
--- trunk/src/utils/pacmd.c (original)
+++ trunk/src/utils/pacmd.c Mon May 22 17:20:46 2006
@@ -32,6 +32,7 @@
 #include <string.h>
 #include <sys/un.h>
 
+#include <polyp/error.h>
 #include <polyp/util.h>
 
 #include <polypcore/core-util.h>
@@ -53,7 +54,7 @@
     }
 
     if ((fd = socket(PF_UNIX, SOCK_STREAM, 0)) < 0) {
-        pa_log(__FILE__": socket(PF_UNIX, SOCK_STREAM, 0): %s", strerror(errno));
+        pa_log(__FILE__": socket(PF_UNIX, SOCK_STREAM, 0): %s", pa_cstrerror(errno));
         goto fail;
     }
 
@@ -65,7 +66,7 @@
         int r;
         
         if ((r = connect(fd, (struct sockaddr*) &sa, sizeof(sa))) < 0 && (errno != ECONNREFUSED && errno != ENOENT)) {
-            pa_log(__FILE__": connect() failed: %s", strerror(errno));
+            pa_log(__FILE__": connect(): %s", pa_cstrerror(errno));
             goto fail;
         }
             
@@ -96,7 +97,7 @@
     
     for (;;) {
         if (select(FD_SETSIZE, &ifds, &ofds, NULL, NULL) < 0) {
-            pa_log(__FILE__": select() failed: %s", strerror(errno));
+            pa_log(__FILE__": select(): %s", pa_cstrerror(errno));
             goto fail;
         }
 
@@ -108,7 +109,7 @@
                 if (r == 0)
                     break;
                 
-                pa_log(__FILE__": read() failed: %s", strerror(errno));
+                pa_log(__FILE__": read(): %s", pa_cstrerror(errno));
                 goto fail;
             }
             
@@ -124,7 +125,7 @@
                 if (r == 0)
                     break;
                 
-                pa_log(__FILE__": read() failed: %s", strerror(errno));
+                pa_log(__FILE__": read(): %s", pa_cstrerror(errno));
                 goto fail;
             }
 
@@ -137,7 +138,7 @@
             assert(obuf_length);
             
             if ((r = write(1, obuf + obuf_index, obuf_length)) < 0) {
-                pa_log(__FILE__": write() failed: %s", strerror(errno));
+                pa_log(__FILE__": write(): %s", pa_cstrerror(errno));
                 goto fail;
             }
             
@@ -151,7 +152,7 @@
             assert(ibuf_length);
             
             if ((r = write(fd, ibuf + ibuf_index, ibuf_length)) < 0) {
-                pa_log(__FILE__": write() failed: %s", strerror(errno));
+                pa_log(__FILE__": write(): %s", pa_cstrerror(errno));
                 goto fail;
             }
             




More information about the pulseaudio-commits mailing list