Kaynağa Gözat

drop explicit check for EWOULDBLOCK if it has the same value as EAGAIN

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
David Kalnischkies 10 yıl önce
ebeveyn
işleme
3b0e76ec9c
1 değiştirilmiş dosya ile 4 ekleme ve 0 silme
  1. 4 0
      apt-pkg/contrib/strutl.cc

+ 4 - 0
apt-pkg/contrib/strutl.cc

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