ithewei 4 éve
szülő
commit
48723c67c2
1 módosított fájl, 5 hozzáadás és 1 törlés
  1. 5 1
      http/server/FileCache.cpp

+ 5 - 1
http/server/FileCache.cpp

@@ -28,7 +28,11 @@ file_cache_t* FileCache::Open(const char* filepath, void* ctx) {
         }
     }
     if (fc == NULL || modified) {
-        int fd = open(filepath, O_RDONLY);
+        int flags = O_RDONLY;
+#ifdef O_BINARY
+        flags |= O_BINARY;
+#endif
+        int fd = open(filepath, flags);
         if (fd < 0) {
             return NULL;
         }