Deal reopens three Libyan oil terminals