未验证 提交 97708abb 编写于 作者: O openharmony_ci 提交者: Gitee

!648 fix: utils wait for file

Merge pull request !648 from Mupceet/0520xytutils
......@@ -264,10 +264,10 @@ void WaitForFile(const char *source, unsigned int maxSecond)
/* 500ms interval, check maxSecond*2 times total */
unsigned int maxCount = maxSecond * 2;
unsigned int count = 0;
do {
while ((stat(source, &sourceInfo) < 0) && (errno == ENOENT) && (count < maxCount)) {
usleep(waitTime);
count++;
} while ((stat(source, &sourceInfo) < 0) && (errno == ENOENT) && (count < maxCount));
}
INIT_CHECK_ONLY_ELOG(count != maxCount, "wait for file:%s failed after %d second.", source, maxSecond);
return;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册