]> git.saurik.com Git - apt.git/commitdiff
drop explicit check for EWOULDBLOCK if it has the same value as EAGAIN
authorDavid Kalnischkies <david@kalnischkies.de>
Mon, 25 Jan 2016 19:05:54 +0000 (20:05 +0100)
committerDavid Kalnischkies <david@kalnischkies.de>
Tue, 26 Jan 2016 14:32:15 +0000 (15:32 +0100)
gcc correctly reports that we check for the same value twice, expect
that the manpage of read(2) tells us to do it for portability, so to
make both sides happy lets add a little #if'ing here.

Reported-By: gcc-6
Git-Dch: Ignore

apt-pkg/contrib/strutl.cc

index 856e5ee9faebcb1cdecae5f4640d6bf93d4928bf..5e641a02b23524396e68dfadf81eb2d0c3d3f266 100644 (file)
@@ -788,7 +788,11 @@ bool ReadMessages(int Fd, vector<string> &List)
         return false;
 
       // No data
+#if EAGAIN != EWOULDBLOCK
       if (Res < 0 && (errno == EAGAIN || errno == EWOULDBLOCK))
+#else
+      if (Res < 0 && errno == EAGAIN)
+#endif
         return true;
       if (Res < 0)
         return false;