From 7bedf24c8caff7af0bce631215a50b02bea79d8c Mon Sep 17 00:00:00 2001
From: Mark Spencer <markster@digium.com>
Date: Sun, 24 Apr 2005 22:54:50 +0000
Subject: [PATCH] If poll returns 0, force *ms to 0

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5502 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 channel.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/channel.c b/channel.c
index 9d6007c644..5eb680d020 100755
--- a/channel.c
+++ b/channel.c
@@ -1126,6 +1126,12 @@ struct ast_channel *ast_waitfor_nandfds(struct ast_channel **c, int n, int *fds,
 #endif			
 		}
 		return NULL;
+        } else {
+        	/* If no fds signalled, then timeout. So set ms = 0
+		   since we may not have an exact timeout.
+		*/
+		if (res == 0)
+			*ms = 0;
 	}
 
 	if (havewhen)
-- 
GitLab