Changeset: faa5e004d6f6 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=faa5e004d6f6
Modified Files:
        tools/merovingian/daemon/client.c
Branch: Apr2011
Log Message:

accept_connections: don't wait for undefinite time with select

On FreeBSD, it seems select() calls don't break when a signal is
received, so make sure we timeout periodically.


diffs (24 lines):

diff --git a/tools/merovingian/daemon/client.c 
b/tools/merovingian/daemon/client.c
--- a/tools/merovingian/daemon/client.c
+++ b/tools/merovingian/daemon/client.c
@@ -409,6 +409,7 @@
        fd_set fds;
        int msgsock;
        err e;
+       struct timeval tv;
 
        do {
                /* handle socket connections */
@@ -416,8 +417,11 @@
                FD_SET(sock, &fds);
                FD_SET(usock, &fds);
 
+               /* Wait up to 5 seconds */
+               tv.tv_sec = 5;
+               tv.tv_usec = 0;
                retval = select((sock > usock ? sock : usock) + 1,
-                               &fds, NULL, NULL, NULL);
+                               &fds, NULL, NULL, &tv);
                if (retval == 0) {
                        /* nothing interesting has happened */
                        continue;
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to