From 858bd245a96d4276123dc0a8a10c9745c1e81f2f Mon Sep 17 00:00:00 2001 From: JINMEI Tatuya Date: Fri, 30 Oct 2009 22:34:59 +0000 Subject: [PATCH] FD_ZERO/SET must be done everytime before select(). git-svn-id: svn://bind10.isc.org/svn/bind10/branches/f2f200910@264 e5f2f494-b856-4b98-b285-d166d9295462 --- src/bin/parkinglot/main.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/bin/parkinglot/main.cc b/src/bin/parkinglot/main.cc index 3c0ad18fcf..2ad64ac533 100644 --- a/src/bin/parkinglot/main.cc +++ b/src/bin/parkinglot/main.cc @@ -79,12 +79,12 @@ main(int argc, char* argv[]) { int ss = session.getSocket(); int nfds = max(ps, ss) + 1; - FD_ZERO(&fds); - FD_SET(ps, &fds); - FD_SET(ss, &fds); - cout << "server running" << endl; while (true) { + FD_ZERO(&fds); + FD_SET(ps, &fds); + FD_SET(ss, &fds); + int n = select(nfds, &fds, NULL, NULL, NULL); if (n < 0) throw FatalError("select error");