Attn: Fix CI complaint of unused-results

Use the results provided by file read/write operations. For mismatch in
number of bytes written on ffdc data creation we add a trace message,
for mismatch in number of bytes read during pel creation we skip
creating the pel.

Signed-off-by: Ben Tyner <ben.tyner@ibm.com>
Change-Id: I3ec6755ef258ac869775b08afafae324a76a2884
diff --git a/attn/attn_dbus.cpp b/attn/attn_dbus.cpp
index 72b637e..0903206 100644
--- a/attn/attn_dbus.cpp
+++ b/attn/attn_dbus.cpp
@@ -131,11 +131,21 @@
     // Create FFDC file from buffer data
     util::FFDCFile pelFile{util::FFDCFormat::Text};
     auto fd = pelFile.getFileDescriptor();
-    write(fd, i_buffer.data(), i_buffer.size());
-    lseek(fd, 0, SEEK_SET);
 
     auto filePath = pelFile.getPath(); // path to ffdc file
 
+    size_t numBytes = write(fd, i_buffer.data(), i_buffer.size());
+    if (i_buffer.size() != numBytes)
+    {
+        std::stringstream traceMsg;
+        traceMsg << filePath.c_str() << " only " << (int)numBytes << " of "
+                 << (int)i_buffer.size() << " bytes written";
+        auto strobj = traceMsg.str();
+        trace<level::ERROR>(strobj.c_str());
+    }
+
+    lseek(fd, 0, SEEK_SET);
+
     // Additional data for log
     std::map<std::string, std::string> additional;
     additional.emplace("RAWPEL", filePath.string());