X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/6c3114a1ec31d54d935f4d8395ef4816ae250295..c2b2f6538f1c946c2da36cde22b43c174ea19a34:/projects/stargazer/plugins/configuration/sgconfig/rsconf.cpp?ds=sidebyside

diff --git a/projects/stargazer/plugins/configuration/sgconfig/rsconf.cpp b/projects/stargazer/plugins/configuration/sgconfig/rsconf.cpp
index b4cbf544..c0b7b325 100644
--- a/projects/stargazer/plugins/configuration/sgconfig/rsconf.cpp
+++ b/projects/stargazer/plugins/configuration/sgconfig/rsconf.cpp
@@ -26,7 +26,7 @@
 *
 *******************************************************************/
 
-#include <unistd.h> // cloase, usleep
+#include <unistd.h> // close
 
 #include <cerrno>
 #include <csignal>
@@ -250,7 +250,7 @@ while (pos < stgHdrLen)
         return -1;
         }
     int ret = recv(sock, &buf[pos], stgHdrLen - pos, 0);
-    if (ret < 0)
+    if (ret <= 0)
         {
         state = confHdr;
         return -1;
@@ -310,7 +310,7 @@ while (pos < ADM_LOGIN_LEN) {
 
     int ret = recv(sock, &login[pos], ADM_LOGIN_LEN - pos, 0);
 
-    if (ret < 0)
+    if (ret <= 0)
         {
         // Error in network
         state = confHdr;
@@ -359,7 +359,7 @@ while (pos < ADM_LOGIN_LEN)
 
     int ret = recv(sock, &loginS[pos], ADM_LOGIN_LEN - pos, 0);
 
-    if (ret < 0)
+    if (ret <= 0)
         {
         // Network error
         printfd(__FILE__, "recv error: '%s'\n", strerror(errno));