With less than hour to spare, the Senate late Friday backed legislation averting a government shutdown as coal-state Democrats retreated on long-term health care benefits for retired miners but promised a renewed fight for the working class next year.