minor comments, but: I prefer not to have serious side effects inside if statements, at least with ||. But I think our style allows it. If there were separate if/goto I think it would be easier to read.
I'm not wild about dropping errno=0 even if you can prove it isn't necessary. If it is provable, the compiler probably drops it anyway, and it's less robust against future changes to remove it.
