diff options
author | Rosen Penev <rosenp@gmail.com> | 2019-07-31 13:36:15 -0700 |
---|---|---|
committer | Rosen Penev <rosenp@gmail.com> | 2019-07-31 13:38:43 -0700 |
commit | 14328668180d07ced919415f35463f63a99c973d (patch) | |
tree | 0a36a6369515124f2bbd0f2f1107593d1e5243df | |
parent | 85fab04196354146d23ebfae99f64900fd43fc8a (diff) |
libglog: Replace deprecated usleep with nanosleep
Optionally fixes compilation with uClibc-ng.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
-rw-r--r-- | libs/libglog/patches/110-nanosleep.patch | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/libs/libglog/patches/110-nanosleep.patch b/libs/libglog/patches/110-nanosleep.patch new file mode 100644 index 000000000..8d1a2ffa0 --- /dev/null +++ b/libs/libglog/patches/110-nanosleep.patch @@ -0,0 +1,24 @@ +From d7b02b6929baf5b21ee6e15a700b4fc82d962e9c Mon Sep 17 00:00:00 2001 +From: Rosen Penev <rosenp@gmail.com> +Date: Thu, 25 Jul 2019 19:14:42 -0700 +Subject: [PATCH] googletest: Switch to nanosleep + +usleep is deprecated and optionally not available with uClibc-ng. +--- + src/googletest.h | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/googletest.h b/src/googletest.h +index 49ddbc0a..39fb29fb 100644 +--- a/src/googletest.h ++++ b/src/googletest.h +@@ -574,7 +574,8 @@ class Thread { + + static inline void SleepForMilliseconds(int t) { + #ifndef OS_WINDOWS +- usleep(t * 1000); ++ const struct timespec req = {0, t * 1000 * 1000}; ++ nanosleep(&req, NULL); + #else + Sleep(t); + #endif |