diff options
author | David Robillard <d@drobilla.net> | 2024-11-15 09:24:40 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2024-11-17 14:40:27 -0500 |
commit | dddab25a19280a13f08debbd00f99e84e54ef708 (patch) | |
tree | eb879984b674488f3f3037782c04ae2e85b7a910 /src | |
parent | 9e71c9372d25b699d63a8110ab26a3239ca48cd6 (diff) | |
download | jalv-dddab25a19280a13f08debbd00f99e84e54ef708.tar.gz jalv-dddab25a19280a13f08debbd00f99e84e54ef708.tar.bz2 jalv-dddab25a19280a13f08debbd00f99e84e54ef708.zip |
Use nanosleep() instead of usleep()
The old usleep() was declared obsolete by POSIX.1-2001, and removed in
POSIX.1-2008.
Diffstat (limited to 'src')
-rw-r--r-- | src/jalv_console.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/jalv_console.c b/src/jalv_console.c index 2ca69b3..4c10e54 100644 --- a/src/jalv_console.c +++ b/src/jalv_console.c @@ -24,7 +24,7 @@ #ifdef _WIN32 # include <synchapi.h> #else -# include <unistd.h> +# include <time.h> #endif #include <stdbool.h> @@ -299,7 +299,8 @@ jalv_run_custom_ui(Jalv* jalv) # ifdef _WIN32 Sleep(33); # else - usleep(33333); + const struct timespec delay = {0, 33333000}; + nanosleep(&delay, NULL); # endif } |