diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-04-20 22:11:36 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-04-20 22:11:36 +0000 |
commit | f8ea8132f1651b72c488c4e97891d50661e63ad9 (patch) | |
tree | 8840a0a34d1684dfa189d06db4ce3132e3462e9f | |
parent | 7cbe14b4edea3475111583b4aa6537a8af628a7e (diff) |
Merged revisions 189539 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
........
r189539 | tilghman | 2009-04-20 17:10:25 -0500 (Mon, 20 Apr 2009) | 3 lines
Use nanosleep instead of poll.
This is not just because mmichelson suggested it, but also because Mac OS X puked on my poll().
........
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@189540 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | main/stdtime/localtime.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/main/stdtime/localtime.c b/main/stdtime/localtime.c index 59bccf7a0..925ef029b 100644 --- a/main/stdtime/localtime.c +++ b/main/stdtime/localtime.c @@ -239,6 +239,7 @@ static void *inotify_daemon(void *data) } buf; ssize_t res; struct state *cur; + struct timespec ten_seconds = { 10, 0 }; inotify_fd = inotify_init(); @@ -261,7 +262,7 @@ static void *inotify_daemon(void *data) } else if (res < 0) { if (errno == EINTR || errno == EAGAIN) { /* If read fails, then wait a bit, then continue */ - poll(NULL, 0, 10000); + nanosleep(&ten_seconds, NULL); continue; } /* Sanity check -- this should never happen, either */ @@ -322,6 +323,7 @@ static void *notify_daemon(void *data) { struct stat st, lst; struct state *cur; + struct timespec sixty_seconds = { 60, 0 }; ast_mutex_lock(&initialization_lock); ast_cond_signal(&initialization); @@ -330,7 +332,7 @@ static void *notify_daemon(void *data) for (;/*ever*/;) { char fullname[FILENAME_MAX + 1]; - poll(NULL, 0, 60000); + nanosleep(&sixty_seconds, NULL); AST_LIST_LOCK(&zonelist); AST_LIST_TRAVERSE_SAFE_BEGIN(&zonelist, cur, list) { char *name = cur->name; |