mirror of
https://github.com/openharmony/developtools_bytrace.git
synced 2026-07-19 17:08:09 -04:00
fix bytrace Infinite loop issue
Signed-off-by: wenlong12 <wenlong12@huawei.com> Signed-off-by: wenlong12 <wenlong12@huawei.com>
This commit is contained in:
+9
-3
@@ -177,9 +177,15 @@ static string CanonicalizeSpecPath(const char* src)
|
||||
return "";
|
||||
}
|
||||
#else
|
||||
if (realpath(src, resolvedPath) == nullptr) {
|
||||
fprintf(stderr, "Error: _fullpath %s failed", src);
|
||||
return "";
|
||||
if (access(src, F_OK) == 0) {
|
||||
if (realpath(src, resolvedPath) == nullptr) {
|
||||
fprintf(stderr, "Error: _fullpath %s failed", src);
|
||||
return "";
|
||||
}
|
||||
} else {
|
||||
if (sprintf_s(resolvedPath, PATH_MAX, "%s", src) == -1) {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
#endif
|
||||
string res(resolvedPath);
|
||||
|
||||
@@ -283,7 +283,7 @@ MyTrace GetTraceResult(const string& checkContent, const vector<string>& list)
|
||||
regex pattern(checkContent);
|
||||
smatch match;
|
||||
Param param {""};
|
||||
for (unsigned int i = list.size() - 1; i >= 0; i--) {
|
||||
for (int i = list.size() - 1; i >= 0; i--) {
|
||||
if (regex_match(list[i], match, pattern)) {
|
||||
param.m_task = match[TASK];
|
||||
param.m_tid = match[TID];
|
||||
|
||||
Reference in New Issue
Block a user