Fix code for warnings: unused-but-set-variable and warn_unused_result.

This commit is contained in:
Niclas Antti
2018-10-03 13:40:07 +03:00
parent 10a8f1d48c
commit 268e689dc5
2 changed files with 7 additions and 6 deletions

View File

@ -493,8 +493,9 @@ bool mxb_log_init(const char* ident,
if (this_unit.sLogger && this_unit.redirect_stdout)
{
// Redirect stdout and stderr to the log file
freopen(this_unit.sLogger->filename(), "a", stdout);
freopen(this_unit.sLogger->filename(), "a", stderr);
FILE* unused __attribute__ ((unused));
unused = freopen(this_unit.sLogger->filename(), "a", stdout);
unused = freopen(this_unit.sLogger->filename(), "a", stderr);
}
break;
@ -620,8 +621,9 @@ bool mxb_log_rotate()
if (this_unit.redirect_stdout && rval)
{
// Redirect stdout and stderr to the log file
freopen(this_unit.sLogger->filename(), "a", stdout);
freopen(this_unit.sLogger->filename(), "a", stderr);
FILE* unused __attribute__ ((unused));
unused = freopen(this_unit.sLogger->filename(), "a", stdout);
unused = freopen(this_unit.sLogger->filename(), "a", stderr);
}
return rval;

View File

@ -863,10 +863,9 @@ bool MariaDBMonitor::failover_perform(ClusterOperation& op)
* time is out at this point, wait_cluster_stabilization() will check the slaves
* once so that latest status is printed. */
wait_cluster_stabilization_ex(op, redirected_slaves);
auto step4_time = timer.lap();
MXS_DEBUG("Failover: slave replication confirmation took %.1f seconds with "
"%.1f seconds to spare.",
step4_time.secs(), op.time_remaining.secs());
timer.lap(), op.time_remaining.secs());
}
}
return rval;