Fixed logging that ignored h_errno.