Skip to content

Commit

Permalink
fix munmap return value condition
Browse files Browse the repository at this point in the history
  • Loading branch information
syoyo committed Oct 18, 2024
1 parent defe688 commit aef0513
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/io-util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ bool UnmapFile(const MMapFileHandle &handle, std::string *err) {
#else // !WIN32
if (handle.addr && handle.size) {
int ret = munmap(reinterpret_cast<void *>(handle.addr), size_t(handle.size));
if (!ret) {
if (ret != 0) { // 0 = success
if (err) {
(*err) += "warning: munmap failed.";
}
Expand Down

0 comments on commit aef0513

Please sign in to comment.