Close if nread <= 0