Protect against spurious connection events.
[tinc] / src / event.c
index 095e7c3..27b884c 100644 (file)
@@ -1,6 +1,6 @@
 /*
     event.c -- I/O, timeout and signal event handling
-    Copyright (C) 2012 Guus Sliepen <guus@tinc-vpn.org>
+    Copyright (C) 2012-2013 Guus Sliepen <guus@tinc-vpn.org>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -225,7 +225,7 @@ bool event_loop(void) {
 #endif
 
                if(n < 0) {
-                       if(sockwouldblock(errno))
+                       if(sockwouldblock(sockerrno))
                                continue;
                        else
                                return false;