]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
mqttd: s/errno/SOCKERRNO
authorDaniel Stenberg <daniel@haxx.se>
Wed, 15 Apr 2020 13:48:38 +0000 (15:48 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 16 Apr 2020 14:41:21 +0000 (16:41 +0200)
To behave proper on Windows
Reported-by: Gisle Vanem
Bug: https://github.com/curl/curl/commit/5e855bbd18f84a02c951be7cac6188276818cdac#r38507132
Closes #5241

tests/server/mqttd.c

index 435df69a1b306804bbfd2336ef206c0c7dfb4fb0..d9ad5923e811dd900816328f73cd310055f445cc 100644 (file)
@@ -643,7 +643,7 @@ static bool incoming(curl_socket_t listenfd)
         logmsg("signalled to die, exiting...");
         return FALSE;
       }
-    } while((rc == -1) && ((error = errno) == EINTR));
+    } while((rc == -1) && ((error = SOCKERRNO) == EINTR));
 
     if(rc < 0) {
       logmsg("select() failed with error: (%d) %s",
@@ -700,9 +700,7 @@ static curl_socket_t sockdaemon(curl_socket_t sock,
         rc = wait_ms(delay);
         if(rc) {
           /* should not happen */
-          error = errno;
-          logmsg("wait_ms() failed with error: (%d) %s",
-                 error, strerror(error));
+          logmsg("wait_ms() failed with error: %d", rc);
           sclose(sock);
           return CURL_SOCKET_BAD;
         }