mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-06 13:29:56 -05:00
Wrap strerror() in a function that makes it thread safe and converts the
output to UTF-8. git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@945 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
bf09399d0e
commit
4e3dc7ce68
49 changed files with 337 additions and 169 deletions
|
|
@ -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 @@ static int do_read(pa_ioline *l) {
|
|||
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 @@ static int do_write(pa_ioline *l) {
|
|||
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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue