Skip to content

Commit 2f6a8c0

Browse files
committed
Minor bug fix for not passing the Travis CI build.
(baidu#1279)
1 parent 81edfb1 commit 2f6a8c0

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/sdk/client_impl.cc

+7-3
Original file line numberDiff line numberDiff line change
@@ -1195,7 +1195,7 @@ static int InitFlags(const std::string& confpath, const std::string& log_prefix)
11951195
LOG(ERROR) << "should specify no more than one config file";
11961196
return -1;
11971197
}
1198-
1198+
std::string exedir = GetProcessDir();
11991199
if (!confpath.empty() && IsExist(confpath)){
12001200
flagfile = confpath;
12011201
} else if(!confpath.empty() && !IsExist(confpath)){
@@ -1207,10 +1207,14 @@ static int InitFlags(const std::string& confpath, const std::string& log_prefix)
12071207
} else if (!FLAGS_tera_sdk_conf_file.empty() && !IsExist(confpath)) {
12081208
LOG(ERROR) << "specified config file(FLAGS_tera_sdk_conf_file) not found";
12091209
return -1;
1210-
} else if (IsExist(GetProcessDir()+"./tera.flag")) {
1210+
} else if (IsExist("./tera.flag")) {
12111211
flagfile = "./tera.flag";
1212-
} else if (IsExist(GetProcessDir()+"/../conf/tera.flag")) {
1212+
} else if (IsExist("../conf/tera.flag")) {
12131213
flagfile = "../conf/tera.flag";
1214+
} else if (IsExist(exedir + "/./tera.flag")) {
1215+
flagfile = exedir + "/./tera.flag";
1216+
} else if (IsExist(exedir + "/../conf/tera.flag")) {
1217+
flagfile = exedir + "/../conf/tera.flag";
12141218
} else if (IsExist(utils::GetValueFromEnv("TERA_CONF"))) {
12151219
flagfile = utils::GetValueFromEnv("TERA_CONF");
12161220
} else {

0 commit comments

Comments
 (0)