On the second law from the standpoint of the equation of state