From 6a34d19cc5136ce193b733971e07738549d5651a Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Tue, 26 May 2015 20:36:41 +0300 Subject: [PATCH] Style fixes in uavcan_posix/dynamic_node_id_server --- .../dynamic_node_id_server/file_event_tracer.hpp | 6 +++--- .../dynamic_node_id_server/file_storage_backend.hpp | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/libuavcan_drivers/posix/include/uavcan_posix/dynamic_node_id_server/file_event_tracer.hpp b/libuavcan_drivers/posix/include/uavcan_posix/dynamic_node_id_server/file_event_tracer.hpp index 863d7465a1..45a6d11c12 100644 --- a/libuavcan_drivers/posix/include/uavcan_posix/dynamic_node_id_server/file_event_tracer.hpp +++ b/libuavcan_drivers/posix/include/uavcan_posix/dynamic_node_id_server/file_event_tracer.hpp @@ -54,8 +54,8 @@ protected: int n = snprintf(buffer, FormatBufferLength, "%ld.%06ld\t%d\t%lld\n", static_cast(ts.tv_sec), static_cast(ts.tv_nsec / 1000L), static_cast(code), static_cast(argument)); - write(fd, buffer, n); - close(fd); + (void)write(fd, buffer, n); // TODO FIXME Write loop + (void)close(fd); } } @@ -76,7 +76,7 @@ public: int fd = open(path_.c_str(), O_RDWR | O_CREAT | O_TRUNC, FilePermissions); if (fd >= 0) { - close(fd); + (void)close(fd); } } return rv; diff --git a/libuavcan_drivers/posix/include/uavcan_posix/dynamic_node_id_server/file_storage_backend.hpp b/libuavcan_drivers/posix/include/uavcan_posix/dynamic_node_id_server/file_storage_backend.hpp index a2834c6cfb..76c515a8cb 100644 --- a/libuavcan_drivers/posix/include/uavcan_posix/dynamic_node_id_server/file_storage_backend.hpp +++ b/libuavcan_drivers/posix/include/uavcan_posix/dynamic_node_id_server/file_storage_backend.hpp @@ -43,6 +43,7 @@ class FileStorageBackend : public uavcan::dynamic_node_id_server::IStorageBacken PathString base_path; +protected: virtual String get(const String& key) const { using namespace std; @@ -80,7 +81,7 @@ class FileStorageBackend : public uavcan::dynamic_node_id_server::IStorageBacken int fd = open(path.c_str(), O_WRONLY | O_CREAT | O_TRUNC, FilePermissions); if (fd >= 0) { - (void)write(fd, value.c_str(), value.size()); + (void)write(fd, value.c_str(), value.size()); // TODO FIXME Write loop (void)fsync(fd); (void)close(fd); }