mirror of
https://github.com/monero-project/monero.git
synced 2024-12-13 20:06:32 +02:00
Merge pull request #4069
49dc78d
util: fix mistakes made in #3994 (stoffu)
This commit is contained in:
commit
65c09beaf7
@ -226,19 +226,19 @@ namespace tools
|
|||||||
MERROR("Failed to open " << filename << ": " << std::error_code(GetLastError(), std::system_category()));
|
MERROR("Failed to open " << filename << ": " << std::error_code(GetLastError(), std::system_category()));
|
||||||
}
|
}
|
||||||
#else
|
#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 (m_fd != -1)
|
||||||
{
|
{
|
||||||
if (flock(m_fd, LOCK_EX | LOCK_NB) == -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);
|
close(m_fd);
|
||||||
m_fd = -1;
|
m_fd = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MERROR("Failed to open " << filename << ": " << std::strerr(errno));
|
MERROR("Failed to open " << filename << ": " << std::strerror(errno));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user