[Asterisk-cvs] asterisk/channels chan_zap.c,1.493,1.494

kpfleming kpfleming
Wed Aug 31 18:11:18 CDT 2005


Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv30796/channels

Modified Files:
	chan_zap.c 
Log Message:
ensure revents fields are initialized before calling poll()


Index: chan_zap.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_zap.c,v
retrieving revision 1.493
retrieving revision 1.494
diff -u -d -r1.493 -r1.494
--- chan_zap.c	31 Aug 2005 05:02:33 -0000	1.493
+++ chan_zap.c	31 Aug 2005 22:12:23 -0000	1.494
@@ -2645,6 +2645,7 @@
 					size = READ_SIZE;
 				fds[0].fd = fd;
 				fds[0].events = POLLPRI | POLLOUT;
+				fds[0].revents = 0;
 				res = poll(fds, 1, -1);
 				if (!res) {
 					ast_log(LOG_DEBUG, "poll (for write) ret. 0 on channel %d\n", p->channel);
@@ -6271,6 +6272,7 @@
 					/* This needs to be watched, as it lacks an owner */
 					pfds[count].fd = i->subs[SUB_REAL].zfd;
 					pfds[count].events = POLLPRI;
+					pfds[count].revents = 0;
 					/* Message waiting or r2 channels also get watched for reading */
 #ifdef ZAPATA_R2
 					if (i->cidspill || i->r2)
@@ -7831,6 +7833,7 @@
 				break;
 			fds[i].fd = pri->fds[i];
 			fds[i].events = POLLIN | POLLPRI;
+			fds[i].revents = 0;
 		}
 		numdchans = i;
 		time(&t);
@@ -10785,6 +10788,7 @@
 			size = READ_SIZE;
 		fds[0].fd = fd;
 		fds[0].events = POLLOUT | POLLPRI;
+		fds[0].revents = 0;
 		res = poll(fds, 1, -1);
 		if (!res) {
 			ast_log(LOG_DEBUG, "poll (for write) ret. 0 on channel %d\n", p->channel);




More information about the svn-commits mailing list