Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/MQClientAPIImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,15 @@ string MQClientAPIImpl::fetchNameServerAddr(const string& NSDomain) {
// update the snapshot local file if nameSrv changes or
// m_firstFetchNameSrv==true
if (writeDataToFile(fileBak, addrs, true)) {
if (UtilAll::ReplaceFile(fileBak, file) == -1)
if (!UtilAll::ReplaceFile(fileBak, file))
LOG_ERROR("could not rename bak file:%s", strerror(errno));
}
}

if (!boost::filesystem::exists(snapshot_file)) {
// the name server snapshot local file maybe deleted by force, create it
if (writeDataToFile(fileBak, m_nameSrvAddr, true)) {
if (UtilAll::ReplaceFile(fileBak, file) == -1)
if (!UtilAll::ReplaceFile(fileBak, file))
LOG_ERROR("could not rename bak file:%s", strerror(errno));
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/consumer/OffsetStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ void LocalFileOffsetStore::persistAll(const std::vector<MQMessageQueue>& mqs) {
"persistAll:open offset store file failed", -1);
}
s.close();
if (UtilAll::ReplaceFile(storefile_bak, m_storeFile) == -1)
if (!UtilAll::ReplaceFile(storefile_bak, m_storeFile))
LOG_ERROR("could not rename bak file:%s", strerror(errno));
m_offsetTable_tmp.clear();
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/producer/DefaultMQProducer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ void DefaultMQProducer::setMaxMessageSize(int maxMessageSize) {
int DefaultMQProducer::getCompressLevel() const { return m_compressLevel; }

void DefaultMQProducer::setCompressLevel(int compressLevel) {
assert(compressLevel >= 0 && compressLevel <= 9 || compressLevel == -1);
assert((compressLevel >= 0 && compressLevel <= 9) || compressLevel == -1);

m_compressLevel = compressLevel;
}
Expand Down