A majority of the US Senate voted on Wednesday to pass a stopgap funding bill to avoid a partial government shutdown beginning on Saturday.