summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmmanuel Dreyfus <manu@netbsd.org>2011-10-16 08:09:11 +0200
committerAnand Avati <avati@gluster.com>2011-11-23 23:49:03 -0800
commit79c379c70ced3fd8a487cf007ba6c82b0773fb9a (patch)
tree635532073e3cc683494b08dadc55513ae54c0c43
parent8b8459b5ee5d3bd2dbbf416e12a1be0cd90c270f (diff)
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 <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Anand Avati <avati@gluster.com>
-rw-r--r--libglusterfs/src/timer.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libglusterfs/src/timer.c b/libglusterfs/src/timer.c
index c2d743b3a28..d8f53a8d18e 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 (&reg->lock);