]> granicus.if.org Git - pdns/commitdiff
Fix a shadowed variable wrt EINTR handling in isTCPSocketUsable()
authorRemi Gacogne <remi.gacogne@powerdns.com>
Sat, 21 Oct 2017 11:09:06 +0000 (13:09 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 23 Oct 2017 10:18:52 +0000 (12:18 +0200)
This would have prevented us from looping as long as we keep getting
interrupted.
Reported by GCC with -Wshadow enabled.

pdns/iputils.cc

index 6549431d12c683a2485825116567eace148ad4b0..d6facc02958f314afa2bf0bcc25e26fc317638a7 100644 (file)
@@ -425,7 +425,7 @@ bool isTCPSocketUsable(int sock)
       return false;
     }
     else {
-      int err = errno;
+      err = errno;
 
       if (err == EAGAIN || err == EWOULDBLOCK) {
         /* socket is usable, no data waiting */