X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fevent.c;h=27b884c46cc1eaa2db247bbc2409cc832e4d5e7f;hb=cc284e7c5d298ca887c07f918da35e376bf98720;hp=6b730f6d153de426eb1f919638c590c626f3328c;hpb=3847b78ba5900fe4311e9ef62474e32e1a6750e5;p=tinc diff --git a/src/event.c b/src/event.c index 6b730f6d..27b884c4 100644 --- a/src/event.c +++ b/src/event.c @@ -1,6 +1,6 @@ /* event.c -- I/O, timeout and signal event handling - Copyright (C) 2012 Guus Sliepen + Copyright (C) 2012-2013 Guus Sliepen 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; @@ -245,6 +245,12 @@ bool event_loop(void) { return true; } +void event_flush_output(void) { + for splay_each(io_t, io, &io_tree) + if(FD_ISSET(io->fd, &writefds)) + io->cb(io->data, IO_WRITE); +} + void event_exit(void) { running = false; }