diff --git a/channel.c b/channel.c
index 9d6007c6447bde644598c9d3d1c6d395cc55bffc..5eb680d0205cb26e05f387317a894efa13f0c3e1 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)