[Asterisk-cvs] asterisk asterisk.c, 1.177, 1.178 channel.c, 1.236, 1.237 io.c, 1.12, 1.13

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


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

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


Index: asterisk.c
===================================================================
RCS file: /usr/cvsroot/asterisk/asterisk.c,v
retrieving revision 1.177
retrieving revision 1.178
diff -u -d -r1.177 -r1.178
--- asterisk.c	23 Aug 2005 01:37:26 -0000	1.177
+++ asterisk.c	31 Aug 2005 22:12:23 -0000	1.178
@@ -436,8 +436,10 @@
 	for(;;) {
 		fds[0].fd = con->fd;
 		fds[0].events = POLLIN;
+		fds[0].revents = 0;
 		fds[1].fd = con->p[0];
 		fds[1].events = POLLIN;
+		fds[1].revents = 0;
 
 		res = poll(fds, 2, -1);
 		if (res < 0) {

Index: channel.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channel.c,v
retrieving revision 1.236
retrieving revision 1.237
diff -u -d -r1.236 -r1.237
--- channel.c	31 Aug 2005 21:28:12 -0000	1.236
+++ channel.c	31 Aug 2005 22:12:23 -0000	1.237
@@ -1246,6 +1246,7 @@
 			if (c[x]->fds[y] > -1) {
 				pfds[max].fd = c[x]->fds[y];
 				pfds[max].events = POLLIN | POLLPRI;
+				pfds[max].revents = 0;
 				max++;
 			}
 		}
@@ -1255,6 +1256,7 @@
 		if (fds[x] > -1) {
 			pfds[max].fd = fds[x];
 			pfds[max].events = POLLIN | POLLPRI;
+			pfds[max].revents = 0;
 			max++;
 		}
 	}

Index: io.c
===================================================================
RCS file: /usr/cvsroot/asterisk/io.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- io.c	19 Jul 2005 13:44:42 -0000	1.12
+++ io.c	31 Aug 2005 22:12:23 -0000	1.13
@@ -165,6 +165,7 @@
 	 */
 	ioc->fds[ioc->fdcnt].fd = fd;
 	ioc->fds[ioc->fdcnt].events = events;
+	ioc->fds[ioc->fdcnt].revents = 0;
 	ioc->ior[ioc->fdcnt].callback = callback;
 	ioc->ior[ioc->fdcnt].data = data;
 	ioc->ior[ioc->fdcnt].id = (int *)malloc(sizeof(int));




More information about the svn-commits mailing list