From 0a051206787d83314ac69cf4c8857c0e880feaed Mon Sep 17 00:00:00 2001
From: Erik Faye-Lund <kusmabite@gmail.com>
Date: Thu, 26 Aug 2010 09:48:55 +0200
Subject: [PATCH] poll: return immediately on POLLHUP.

* lib/poll.c (poll): Always set timeout before wait_timeout is
computed.
---
 ChangeLog  | 6 ++++++
 lib/poll.c | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index ab5eccc7b2..836f553fb6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-08-26  Erik Faye-Lund  <kusmabite@gmail.com>
+
+	poll: return immediately on POLLHUP.
+	* lib/poll.c (poll): Always set timeout before wait_timeout is
+	computed.
+
 2010-08-25  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
 	Fix test-unlinkat, test-rmdir failure on AIX 5.3.
diff --git a/lib/poll.c b/lib/poll.c
index aeb7a356fc..7c52cb6a26 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;
         }
     }
 
-- 
2.39.5