diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2021-02-14 16:50:32 -0800 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2021-02-14 16:50:32 -0800 |
commit | b31ee4be7739ccd8cf36048da212410514758949 (patch) | |
tree | 5d5a7a16f27a47c2f4fdd4e015c702526c817ae6 /src/util.h | |
parent | 4ba92170fcc18d5c194f3bc18ea96d36adf9d9ce (diff) |
*fb: improve error propagation out of setup/init
A lot of errors were being conflated as ENOMEM due to the lazy
use of NULL pointer returns for errors.
This commit reworks a handful of those return paths to instead
return an errno-style int, storing the results on success at a
supplied result pointer.
It's kind of ugly, and I make some assumptions about libdrm
setting errno on failure - it too uses this lazy API of returning
NULL pointers on failure. Hopefully errno is always set by an
underlying ioctl failing.
The SDL error API is also pretty gross, being cross-platform it
defines its own error codes so I try vaguely map these to errno
values.
I'm considering this a first approximation at fixing this up, but
there are probably bugs as I did it real fast and nasty.
It at least seems to all still work OK here in the non-error
paths I tested. So it doesn't seem more broken than before at a
glance.
Diffstat (limited to 'src/util.h')
0 files changed, 0 insertions, 0 deletions