Skip to content

Commit

Permalink
util: fix mistakes made in monero-project#3994 /monero#4069
Browse files Browse the repository at this point in the history
  • Loading branch information
stoffu committed Nov 6, 2018
1 parent 462d98b commit 490f23f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/common/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,19 +225,19 @@ namespace tools
MERROR("Failed to open " << filename << ": " << std::error_code(GetLastError(), std::system_category()));
}
#else
m_fd = open(filename, O_RDONLY | O_CREAT, 0666);
m_fd = open(filename.c_str(), O_RDONLY | O_CREAT, 0666);
if (m_fd != -1)
{
if (flock(m_fd, LOCK_EX | LOCK_NB) == -1)
{
MERROR("Failed to lock " << filename << ": " << std::strerr(errno));
MERROR("Failed to lock " << filename << ": " << std::strerror(errno));
close(m_fd);
m_fd = -1;
}
}
else
{
MERROR("Failed to open " << filename << ": " << std::strerr(errno));
MERROR("Failed to open " << filename << ": " << std::strerror(errno));
}
#endif
}
Expand Down

0 comments on commit 490f23f

Please sign in to comment.