iSulad/0023-change-sleep-to-usleep-to-avoid-lossing-of-accuracy.patch
zhangxiaoyu 932bd564ae upgrade from upstream
Signed-off-by: zhangxiaoyu <zhangxiaoyu58@huawei.com>
(cherry picked from commit 1adaa5c0c5dd4f162457c656c9d0fd6ffa8f2358)
2023-03-09 10:30:27 +08:00

27 lines
813 B
Diff

From e9bd090e5d6755eacaa1f8710c32386aba5190f2 Mon Sep 17 00:00:00 2001
From: zhongtao <zhongtao17@huawei.com>
Date: Mon, 6 Mar 2023 09:54:44 +0800
Subject: [PATCH 23/26] change sleep() to usleep() to avoid lossing of accuracy
Signed-off-by: zhongtao <zhongtao17@huawei.com>
---
src/utils/cutils/utils.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/utils/cutils/utils.c b/src/utils/cutils/utils.c
index 9173cd14..64d7e9f9 100644
--- a/src/utils/cutils/utils.c
+++ b/src/utils/cutils/utils.c
@@ -347,7 +347,7 @@ int util_waitpid_with_timeout(pid_t pid, const int64_t timeout, handle_timeout_c
return -1;
}
// sleep some time instead to avoid cpu full running and then retry.
- sleep(0.1);
+ usleep(0.1);
}
return 0;
}
--
2.25.1