Bug 206815: fixed a benign UMR in the PR_Poll implementations based on NSPRPUB_PRE_4_2_CLIENT_BRANCH
authorwtc%netscape.com
Fri, 23 May 2003 22:42:21 +0000
branchNSPRPUB_PRE_4_2_CLIENT_BRANCH
changeset 2844 06bab8e7fe98ddb624f79c4ebe69e0f3ab8b257e
parent 2840 845811bb82754fd23de8dc76b9b70eb8f35eca9a
child 2851 1460dd392f950640a861b2e341e665b8fea12dd9
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 Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH
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;