Skip to content

Fix warning while compiling rocketmq_static #47

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 2, 2019
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