mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-03 09:01:50 -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
|
|
@ -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 @@ static int detect_alsa(pa_core *c, int just_one) {
|
|||
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 @@ static int detect_oss(pa_core *c, int just_one) {
|
|||
!(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 @@ static int detect_solaris(pa_core *c, int just_one) {
|
|||
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue