You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
703 B

  1. From d7b02b6929baf5b21ee6e15a700b4fc82d962e9c Mon Sep 17 00:00:00 2001
  2. From: Rosen Penev <rosenp@gmail.com>
  3. Date: Thu, 25 Jul 2019 19:14:42 -0700
  4. Subject: [PATCH] googletest: Switch to nanosleep
  5. usleep is deprecated and optionally not available with uClibc-ng.
  6. ---
  7. src/googletest.h | 3 ++-
  8. 1 file changed, 2 insertions(+), 1 deletion(-)
  9. diff --git a/src/googletest.h b/src/googletest.h
  10. index 49ddbc0a..39fb29fb 100644
  11. --- a/src/googletest.h
  12. +++ b/src/googletest.h
  13. @@ -574,7 +574,8 @@ class Thread {
  14. static inline void SleepForMilliseconds(int t) {
  15. #ifndef OS_WINDOWS
  16. - usleep(t * 1000);
  17. + const struct timespec req = {0, t * 1000 * 1000};
  18. + nanosleep(&req, NULL);
  19. #else
  20. Sleep(t);
  21. #endif