暂时禁用mmap

This commit is contained in:
xiongziliang 2019-10-27 03:00:19 +08:00
parent 6023885e93
commit 4d1d6b1467

View File

@ -34,7 +34,7 @@
#endif #endif
#ifndef _WIN32 #ifndef _WIN32
#define ENABLE_MMAP //#define ENABLE_MMAP
#endif #endif
namespace mediakit { namespace mediakit {
@ -70,7 +70,7 @@ HttpFileBody::HttpFileBody(const std::shared_ptr<FILE> &fp, uint64_t offset, uin
break; break;
} }
auto ptr = (char *) mmap(NULL, max_size, PROT_READ, MAP_SHARED, fd, offset); auto ptr = (char *) mmap(NULL, max_size, PROT_READ, MAP_SHARED, fd, offset);
if (!ptr) { if (ptr == MAP_FAILED) {
WarnL << "mmap failed:" << get_uv_errmsg(false); WarnL << "mmap failed:" << get_uv_errmsg(false);
break; break;
} }