diff options
author | Mark Spencer <markster@digium.com> | 2005-03-05 03:20:55 +0000 |
---|---|---|
committer | Mark Spencer <markster@digium.com> | 2005-03-05 03:20:55 +0000 |
commit | badc4dec4681a14695ef64d067a012d4aaa215fa (patch) | |
tree | 43bbc5fb738257b338682fa55d5417d784661ea2 /utils.c | |
parent | 7f97f0a332c5d65b5cf38ac497d9491d580f07e3 (diff) |
Make mpg123 behave more nicely
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5142 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'utils.c')
-rwxr-xr-x | utils.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -24,6 +24,7 @@ #include <arpa/inet.h> #include <asterisk/lock.h> #include <asterisk/utils.h> +#include <asterisk/io.h> #include <asterisk/logger.h> #include <asterisk/md5.h> @@ -404,6 +405,15 @@ int ast_pthread_create_stack(pthread_t *thread, pthread_attr_t *attr, void *(*st return pthread_create(thread, attr, start_routine, data); /* We're in ast_pthread_create, so it's okay */ } +int ast_wait_for_input(int fd, int ms) +{ + struct pollfd pfd[1]; + memset(pfd, 0, sizeof(pfd)); + pfd[0].fd = fd; + pfd[0].events = POLLIN|POLLPRI; + return poll(pfd, 1, ms); +} + /* Case-insensitive substring matching */ #ifndef LINUX static char *upper(const char *orig, char *buf, int bufsize) |