fix:sleep optimize

Signed-off-by: whoselittlelion <humin16@huawei.com>
This commit is contained in:
whoselittlelion 2024-02-05 12:15:13 +08:00
parent 6d960024f8
commit c25a8f43bb

View File

@ -1169,7 +1169,10 @@ void StopAllServices(int flags, const char **exclude, int size,
}
// sleep 200ms wait for stop service
usleep(200);
int waitTime = 200;
do {
waitTime = usleep(waitTime);
} while (waitTime > 0);
}
Service *GetServiceByPid(pid_t pid)