This is an automated email from the ASF dual-hosted git repository. granthenke pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/kudu.git
commit 3782dd6d74d558d9d7d9ce37a023ae290a26385c Author: Grant Henke <[email protected]> AuthorDate: Wed Mar 11 09:53:55 2020 -0500 [build] Fix compilation when NO_CHRONY is not defined I found when building the test binary jar that compilation fails when `NO_CHRONY` is not defined because `num_ntp_servers` is accessed outside of the `NO_CHRONY` guard but does not exist when `!NO_CHRONY`. This patch fixes compilation by moving it into the guard. Change-Id: I9b6cc4bda188fb56f6dc4c67653ecdaecb7ad2de Reviewed-on: http://gerrit.cloudera.org:8080/15404 Tested-by: Grant Henke <[email protected]> Reviewed-by: Adar Dembo <[email protected]> --- src/kudu/mini-cluster/external_mini_cluster.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/kudu/mini-cluster/external_mini_cluster.cc b/src/kudu/mini-cluster/external_mini_cluster.cc index e368a6e..66da128 100644 --- a/src/kudu/mini-cluster/external_mini_cluster.cc +++ b/src/kudu/mini-cluster/external_mini_cluster.cc @@ -172,10 +172,10 @@ Status ExternalMiniCluster::AddTimeSourceFlags( int idx, std::vector<std::string>* flags) { DCHECK_LE(0, idx); DCHECK(flags); - CHECK_LE(0, opts_.num_ntp_servers); #if defined(NO_CHRONY) flags->emplace_back("--time_source=system_unsync"); #else + CHECK_LE(0, opts_.num_ntp_servers); if (opts_.num_ntp_servers == 0) { flags->emplace_back("--time_source=system_unsync"); } else {
