Bug 206815: fixed a benign UMR in the PR_Poll implementations based on
authorwtc%netscape.com
Fri, 23 May 2003 01:34:51 +0000
changeset 2842 a3bc9b70f84b5c448ea09e43ffd72429f9f2ad07
parent 2838 84d9d95c4ef8bcb55e1f343092c8cd661fba9986
child 2843 91416eb632185bc2c80b31d73df2e9981a520281
push idunknown
push userunknown
push dateunknown
bugs206815
Bug 206815: fixed a benign UMR in the PR_Poll implementations based on poll(). We should initialize the events field of the pollfd structure when we set the fd field to -1 even though the events field is ignored if the fd field is negative. Modified Files: ptio.c uxpoll.c
pr/src/md/unix/uxpoll.c
pr/src/pthreads/ptio.c
--- a/pr/src/md/unix/uxpoll.c
+++ b/pr/src/md/unix/uxpoll.c
@@ -168,16 +168,17 @@ static PRInt32 NativeThreadPoll(
                     pds[index].out_flags = PR_POLL_NVAL;  /* bogii */
                 }
             }
         }
         else
         {
             /* make poll() ignore this entry */
             syspoll[index].fd = -1;
+            syspoll[index].events = 0;
             pds[index].out_flags = 0;
         }
     }
 
     if (0 == ready)
     {
         switch (timeout)
         {
--- a/pr/src/pthreads/ptio.c
+++ b/pr/src/pthreads/ptio.c
@@ -3827,16 +3827,17 @@ static PRInt32 _pr_poll_with_poll(
                         pds[index].out_flags = PR_POLL_NVAL;  /* bogii */
                     }
                 }
             }
             else
             {
                 /* make poll() ignore this entry */
                 syspoll[index].fd = -1;
+                syspoll[index].events = 0;
                 pds[index].out_flags = 0;
             }
         }
         if (0 == ready)
         {
             switch (timeout)
             {
             case PR_INTERVAL_NO_WAIT: msecs = 0; break;