Improve code style for os judgement.