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:
Wim Taymans 2019-06-07 10:11:23 +02:00
parent 0a5bce4a3b
commit 504d78cd18
26 changed files with 359 additions and 148 deletions

View file

@ -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;