mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-31 22:25:33 -04:00
core: Slightly more helpful pa_cstrerror for unknown errors
On Windows, strerror can actually return "Unknown Error" (e.g. for large errnums). The code assumes the return value to be helpful. Make it slightly more helpful by catching the message and appending the errnum.
This commit is contained in:
parent
b342daded9
commit
9f3bba8bd4
1 changed files with 3 additions and 2 deletions
|
|
@ -63,8 +63,9 @@ const char* pa_cstrerror(int errnum) {
|
|||
original = strerror(errnum);
|
||||
#endif
|
||||
|
||||
if (!original) {
|
||||
pa_snprintf(errbuf, sizeof(errbuf), "Unknown error %i", errnum);
|
||||
/* The second condition is a Windows-ism */
|
||||
if (!original || !strcasecmp(original, "Unknown error")) {
|
||||
pa_snprintf(errbuf, sizeof(errbuf), "Unknown error %d", errnum);
|
||||
original = errbuf;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue