From: Joao Eduardo Luis Date: Wed, 17 Oct 2012 14:41:36 +0000 (+0100) Subject: mon: LogMonitor: check return value when writing to file X-Git-Tag: v0.55~268^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0292349dfd13eda325fd217d848515fb66163222;p=ceph.git mon: LogMonitor: check return value when writing to file CID 716851: Unchecked return value (CHECKED_RETURN) At (51): Calling function "ceph::buffer::list::write_fd(int) const" without checking return value. Signed-off-by: Joao Eduardo Luis --- diff --git a/src/mon/LogMonitor.cc b/src/mon/LogMonitor.cc index 84dda7dd6147..f06de5217a0c 100644 --- a/src/mon/LogMonitor.cc +++ b/src/mon/LogMonitor.cc @@ -150,7 +150,11 @@ void LogMonitor::update_from_paxos() int err = -errno; dout(1) << "unable to write to " << g_conf->mon_cluster_log_file << ": " << cpp_strerror(err) << dendl; } else { - blog.write_fd(fd); + int err = blog.write_fd(fd); + if (err < 0) { + dout(1) << "error writing to " << g_conf->mon_cluster_log_file + << ": " << cpp_strerror(err) << dendl; + } TEMP_FAILURE_RETRY(::close(fd)); } }