mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
improve error handling
Set errno for functions returning NULL if relevant. Propagate errno and result codes better. Handle more error cases.
This commit is contained in:
parent
0a5bce4a3b
commit
504d78cd18
26 changed files with 359 additions and 148 deletions
|
|
@ -137,8 +137,10 @@ static inline void *pw_array_add_fixed(struct pw_array *arr, size_t size)
|
|||
{
|
||||
void *p;
|
||||
|
||||
if (SPA_UNLIKELY(arr->alloc < arr->size + size))
|
||||
if (SPA_UNLIKELY(arr->alloc < arr->size + size)) {
|
||||
errno = ENOSPC;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
p = SPA_MEMBER(arr->data, arr->size, void);
|
||||
arr->size += size;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue