automerge commit

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2-netsec@78412 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Automerge Script
2007-08-07 18:44:16 +00:00
parent 53e28cba18
commit a97c27fc27

View File

@@ -1726,20 +1726,14 @@ static int restore_gains(struct zt_pvt *p)
static inline int zt_set_hook(int fd, int hs) static inline int zt_set_hook(int fd, int hs)
{ {
int x, res, count = 0; int x, res;
x = hs; x = hs;
res = ioctl(fd, ZT_HOOK, &x); res = ioctl(fd, ZT_HOOK, &x);
while (res < 0 && count < 20) {
usleep(100000); /* 1/10 sec. */
x = hs;
res = ioctl(fd, ZT_HOOK, &x);
count++;
}
if (res < 0) { if (res < 0) {
if (errno == EINPROGRESS) return 0; if (errno == EINPROGRESS)
return 0;
ast_log(LOG_WARNING, "zt hook failed: %s\n", strerror(errno)); ast_log(LOG_WARNING, "zt hook failed: %s\n", strerror(errno));
} }