Match-id-f7cdfc7a411976f9681dbea6a0d794378ec36d97

This commit is contained in:
BianTanggui
2020-08-11 12:00:52 +08:00
parent fe9f73054c
commit 12c4bbd54a
9 changed files with 130 additions and 11 deletions

View File

@@ -201,12 +201,6 @@ int DoPrepare(const struct CmdArgs *args, struct ParsedConfig *config)
return -1;
}
ret = ParseRuntimeOptions(args->options);
if (ret < 0) {
LogError("error: failed to parse runtime options.");
return -1;
}
return 0;
}
@@ -277,11 +271,34 @@ int Process(int argc, char **argv)
return -1;
}
ret = ParseRuntimeOptions(args.options);
if (ret < 0) {
LogError("error: failed to parse runtime options.");
return -1;
}
SetPidForLog(args.pid);
if (IsOptionVerboseSet()) {
ret = OpenLog(DEFAULT_LOG_FILE);
if (ret < 0) {
LogError("error: failed to open log file %s.", DEFAULT_LOG_FILE);
return -1;
}
}
ret = SetupContainer(&args);
if (ret < 0) {
if (IsOptionVerboseSet()) {
CloseLog();
}
return ret;
}
if (IsOptionVerboseSet()) {
CloseLog();
}
return 0;
}