Rigidity results in generalized isothermal fluids