Retired Marine Corps Gen. James Mattis was confirmed by the Senate to be the next defense secretary, just hours after Donald Trump was sworn in as president.