summaryrefslogtreecommitdiff
path: root/src/main.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2010-04-19 12:53:58 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2010-04-19 12:53:58 +0000
commit0ec50a8d506a7d65ecbc937c7451126dd716c125 (patch)
tree1867959d41e8e833c83aad711020ebff8340fe6f /src/main.cc
parent756592bf4d937f63829fcaaafb38e338417eb407 (diff)
2010-04-19 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Supported poll() for socket event notification. --event-poll can take value "poll". Fixed the bug that timeout for SocketCore::isReadable()/isWritable() is ignored when epoll is used. * src/OptionHandlerFactory.cc * src/a2io.h * src/prefs.h * src/SocketCore.h * src/Makefile.am * src/main.cc * src/PollEventPoll.h * src/SocketCore.cc * src/DownloadEngineFactory.cc * src/PollEventPoll.cc * src/prefs.cc * configure.ac
Diffstat (limited to 'src/main.cc')
-rw-r--r--src/main.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/main.cc b/src/main.cc
index 242dcaa5..945c2e4f 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -191,9 +191,14 @@ downloadresultcode::RESULT main(int argc, char* argv[])
SocketCore::useEpoll();
} else
#endif // HAVE_EPOLL
- if(op->get(PREF_EVENT_POLL) == V_SELECT) {
- SocketCore::useSelect();
- }
+#ifdef HAVE_POLL
+ if(op->get(PREF_EVENT_POLL) == V_POLL) {
+ SocketCore::usePoll();
+ } else
+#endif // HAVE_POLL
+ if(op->get(PREF_EVENT_POLL) == V_SELECT) {
+ SocketCore::useSelect();
+ }
downloadresultcode::RESULT exitStatus = downloadresultcode::FINISHED;
Logger* logger = LogFactory::getInstance();