提交 b682fd80 编写于 作者: M Mupceet

fix: utils wait for file

Signed-off-by: NMupceet <laiguizhong@huawei.com>
上级 6e018620
......@@ -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.
先完成此消息的编辑!
想要评论请 注册