Changeset: f188f0bacd37 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f188f0bacd37
Modified Files:
        
Branch: default
Log Message:

Merged FreeBSD fixes from Apr2011


diffs (72 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;
diff --git a/tools/merovingian/daemon/controlrunner.c 
b/tools/merovingian/daemon/controlrunner.c
--- a/tools/merovingian/daemon/controlrunner.c
+++ b/tools/merovingian/daemon/controlrunner.c
@@ -106,7 +106,7 @@
        tv.tv_sec = 1;
        tv.tv_usec = 0;
        retval = select(msgsock + 1, &fds, NULL, NULL, &tv);
-       if (retval == 0) {
+       if (retval <= 0) {
                /* nothing interesting has happened */
                return(-2);
        }
diff --git a/tools/merovingian/daemon/discoveryrunner.c 
b/tools/merovingian/daemon/discoveryrunner.c
--- a/tools/merovingian/daemon/discoveryrunner.c
+++ b/tools/merovingian/daemon/discoveryrunner.c
@@ -402,7 +402,7 @@
                tv.tv_sec = 5;
                tv.tv_usec = 0;
                nread = select(sock + 1, &fds, NULL, NULL, &tv);
-               if (nread == 0) {
+               if (nread <= 0) {  /* assume only failure is EINTR */
                        /* nothing interesting has happened */
                        buf[0] = '\0';
                        continue;
diff --git a/tools/merovingian/daemon/multiplex-funnel.c 
b/tools/merovingian/daemon/multiplex-funnel.c
--- a/tools/merovingian/daemon/multiplex-funnel.c
+++ b/tools/merovingian/daemon/multiplex-funnel.c
@@ -544,7 +544,7 @@
                }
 
                /* nothing interesting has happened */
-               if (r == 0)
+               if (r <= 0)
                        continue;
                for (c = m->clients; c != NULL; c = c->next) {
                        if (!FD_ISSET(c->sock, &fds))
diff --git a/tools/merovingian/daemon/peering.c 
b/tools/merovingian/daemon/peering.c
--- a/tools/merovingian/daemon/peering.c
+++ b/tools/merovingian/daemon/peering.c
@@ -122,7 +122,7 @@
                tv.tv_usec = 0;
                len = select(msock + 1, &fds, NULL, NULL, &tv);
                /* nothing interesting has happened */
-               if (len == 0)
+               if (len <= 0)
                        continue;
                if (FD_ISSET(s, &fds)) {
                        /* from client, forward to our network */
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to