Fix errno comparison

errno was being assigned instead of being compared