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

Bug#102293: select() can fail with EINTR



Package: apt
Version: 0.5.3

Hi,

one select statement in the HTTP retrieval code was not protected
by the do {} while (Res < 0 && errno == EINTR); loop.  The below patch
fixes that.  And, it happens quite frequently on the Hurd, so it's not
only cosmetic.

Thanks,
Marcus

--- methods/http.cc.prior	Tue Jun 26 01:18:06 2001
+++ methods/http.cc	Tue Jun 26 01:22:38 2001
@@ -722,7 +722,14 @@
    tv.tv_sec = TimeOut;
    tv.tv_usec = 0;
    int Res = 0;
-   if ((Res = select(MaxFd+1,&rfds,&wfds,0,&tv)) < 0)
+
+   do
+   {
+      Res = select(MaxFd+1,&rfds,&wfds,0,&tv);
+   }
+   while (Res < 0 && errno == EINTR);
+
+   if (Res < 0)
       return _error->Errno("select","Select failed");
    
    if (Res == 0)



Reply to: