Everything: errno was not reseted properly before function calls
n.b. errno state is never cleared by the system functions themselves. If the state is not manually cleared its value may be unrelated to the current scope and be a result of some previous call elsewhere.
Showing with 16 additions and 25 deletions