Переглянути джерело

Minor build fixes for Linux/Glibc.

Davin McCall 5 роки тому
батько
коміт
a3aa4bcbf3
2 змінених файлів з 3 додано та 2 видалено
  1. 1 1
      src/control.cc
  2. 2 1
      src/dinitctl.cc

+ 1 - 1
src/control.cc

@@ -617,7 +617,7 @@ bool control_conn_t::query_load_mech()
         std::memcpy(reppkt.data() + curpos - sizeof(uint32_t), &wd_len, sizeof(wd_len));
 
         // Each directory in the load path:
-        for (int i = 0; i < sdirs; i++) {
+        for (int i = 0; uint32_t(i) < sdirs; i++) {
             const char *sdir = dss->get_service_dir(i);
             uint32_t dlen = std::strlen(sdir);
             auto cursize = reppkt.size();

+ 2 - 1
src/dinitctl.cc

@@ -9,6 +9,7 @@
 #include <algorithm>
 
 #include <sys/types.h>
+#include <sys/stat.h>
 #include <sys/wait.h>
 #include <sys/socket.h>
 #include <sys/un.h>
@@ -365,7 +366,7 @@ int main(int argc, char **argv)
 static std::string read_string(int socknum, cpbuffer_t &rbuffer, uint32_t length)
 {
     int rb_len = rbuffer.get_length();
-    if (rb_len >= length) {
+    if (uint32_t(rb_len) >= length) {
         std::string r = rbuffer.extract_string(0, length);
         rbuffer.consume(length);
         return r;