It may not be a good reason to do this, but you can condense
if (failure) {
errno = EINVAL;
return -1;
}
into if (failure)
return (errno = EINVAL, -1);