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

Save value of errno until we need it.
Other system calls may mess up the value.


diffs (30 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
@@ -432,6 +432,7 @@ acceptConnections(int sock, int usock)
        struct timeval tv;
        struct clientdata *data;
        struct threads *threads = NULL, **threadp, *p;
+       int errnr;                                      /* saved errno */
 
        do {
                /* handle socket connections */
@@ -444,6 +445,7 @@ acceptConnections(int sock, int usock)
                tv.tv_usec = 0;
                retval = select((sock > usock ? sock : usock) + 1,
                                &fds, NULL, NULL, &tv);
+               errnr = errno;
                /* join any handleClient threads that we started and that may
                 * have finished by now */
                for (threadp = &threads; *threadp; threadp = &(*threadp)->next) 
{
@@ -469,8 +471,8 @@ acceptConnections(int sock, int usock)
                if (retval == -1) {
                        if (_mero_keep_listening == 0)
                                break;
-                       if (errno != EINTR) {
-                               msg = strerror(errno);
+                       if (errnr != EINTR) {
+                               msg = strerror(errnr);
                                goto error;
                        }
                        continue;
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to