bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lib/poll.c win32 deadlock


From: Paolo Bonzini
Subject: Re: lib/poll.c win32 deadlock
Date: Wed, 25 Aug 2010 18:58:14 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.10) Gecko/20100621 Fedora/3.0.5-1.fc13 Lightning/1.0b2pre Mnenhy/0.8.3 Thunderbird/3.0.5

On 08/25/2010 06:51 PM, Erik Faye-Lund wrote:
On Wed, Aug 25, 2010 at 11:50 AM, Paolo Bonzini<address@hidden>  wrote:
On 08/25/2010 11:48 AM, Erik Faye-Lund wrote:

Actually, when I think of it - if any pipe got POLLHUP already,
shouldn't poll just return right away? I mean, we already have an
event, waiting in that case seems wrong to me.

You would have to see what POSIX says.


POSIX says to only wait if there hasn't been any signaled events: "If
none of the defined events have occurred on any selected file
descriptor, poll() shall wait at least timeout milliseconds for an
event to occur on any of the selected file descriptors."

After reading through the code again, I found that the code ATTEMPTS
to do the right thing, but an unfortunate typo prevented it from
happening:

diff --git a/lib/poll.c b/lib/poll.c
index aeb7a35..7c52cb6 100644
--- a/lib/poll.c
+++ b/lib/poll.c
@@ -505,7 +505,7 @@ poll (pfd, nfd, timeout)
            if (sought)
              handle_array[nhandles++] = h;
            if (pfd[i].revents)
-            wait_timeout = 0;
+            timeout = 0;
          }
      }

Thanks!

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]