From 79c379c70ced3fd8a487cf007ba6c82b0773fb9a Mon Sep 17 00:00:00 2001 From: Emmanuel Dreyfus Date: Sun, 16 Oct 2011 08:09:11 +0200 Subject: usleep(3) shall not be called with argument higher than 1s Change-Id: Ied0a2fedb3b7604f6abbf0a4aa7f71e43a5ea568 BUG: 2923 Reviewed-on: http://review.gluster.com/595 Tested-by: Gluster Build System Reviewed-by: Jeff Darcy Reviewed-by: Anand Avati --- libglusterfs/src/timer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libglusterfs') diff --git a/libglusterfs/src/timer.c b/libglusterfs/src/timer.c index c2d743b3a..d8f53a8d1 100644 --- a/libglusterfs/src/timer.c +++ b/libglusterfs/src/timer.c @@ -136,6 +136,7 @@ void * gf_timer_proc (void *ctx) { gf_timer_registry_t *reg = NULL; + const struct timespec sleepts = {.tv_sec = 1, .tv_nsec = 0, }; if (ctx == NULL) { @@ -178,7 +179,7 @@ gf_timer_proc (void *ctx) else break; } - usleep (1000000); + nanosleep (&sleepts, NULL); } pthread_mutex_lock (®->lock); -- cgit