| Index: components/metrics/serialization/serialization_utils.cc
|
| diff --git a/components/metrics/serialization/serialization_utils.cc b/components/metrics/serialization/serialization_utils.cc
|
| index 0eca24b00eae5f359596db5595d999823272395f..30c2675e67f1b21446939b73958d7ecc3c194739 100644
|
| --- a/components/metrics/serialization/serialization_utils.cc
|
| +++ b/components/metrics/serialization/serialization_utils.cc
|
| @@ -196,17 +196,16 @@ bool SerializationUtils::WriteMetricToFile(const MetricSample& sample,
|
|
|
| // The file containing the metrics samples will only be read by programs on
|
| // the same device so we do not check endianness.
|
| - if (base::WriteFileDescriptor(file_descriptor.get(),
|
| - reinterpret_cast<char*>(&size),
|
| - sizeof(size)) != sizeof(size)) {
|
| - DLOG(ERROR) << "error writing message length " << errno;
|
| + if (!base::WriteFileDescriptor(file_descriptor.get(),
|
| + reinterpret_cast<char*>(&size),
|
| + sizeof(size))) {
|
| + DPLOG(ERROR) << "error writing message length";
|
| return false;
|
| }
|
|
|
| - if (base::WriteFileDescriptor(
|
| - file_descriptor.get(), msg.c_str(), msg.length()) !=
|
| - static_cast<int>(msg.length())) {
|
| - DLOG(ERROR) << "error writing message" << errno;
|
| + if (!base::WriteFileDescriptor(
|
| + file_descriptor.get(), msg.c_str(), msg.size())) {
|
| + DPLOG(ERROR) << "error writing message";
|
| return false;
|
| }
|
|
|
|
|