From 37ace75abc0e9b90b54faa75e43284f219e1dd59 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Tue, 12 May 2015 15:00:32 -1000 Subject: [PATCH] Formated, tested --- .../include/posix_tools/file_event_tracer.hpp | 3 ++- .../include/posix_tools/file_storage_backend.hpp | 13 +++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/libuavcan_drivers/posix_tools/include/posix_tools/file_event_tracer.hpp b/libuavcan_drivers/posix_tools/include/posix_tools/file_event_tracer.hpp index e88e622c85..719e34694d 100644 --- a/libuavcan_drivers/posix_tools/include/posix_tools/file_event_tracer.hpp +++ b/libuavcan_drivers/posix_tools/include/posix_tools/file_event_tracer.hpp @@ -66,7 +66,8 @@ public: rv = 0; path_ = path.c_str(); int fd = open(path_.c_str(), O_RDWR | O_CREAT | O_TRUNC); - if ( fd >= 0) { + if ( fd >= 0) + { close(fd); } } diff --git a/libuavcan_drivers/posix_tools/include/posix_tools/file_storage_backend.hpp b/libuavcan_drivers/posix_tools/include/posix_tools/file_storage_backend.hpp index 55292e7ef6..e5233420cf 100644 --- a/libuavcan_drivers/posix_tools/include/posix_tools/file_storage_backend.hpp +++ b/libuavcan_drivers/posix_tools/include/posix_tools/file_storage_backend.hpp @@ -122,12 +122,13 @@ public: { rv = mkdir(base_path.c_str(), S_IRWXU | S_IRWXG | S_IRWXO); } - if (rv >= 0 ) { - base_path.push_back('/'); - if ((base_path.size() + MaxStringLength) > MaxPathLength) - { - rv = -uavcan::ErrInvalidConfiguration; - } + if (rv >= 0 ) + { + base_path.push_back('/'); + if ((base_path.size() + MaxStringLength) > MaxPathLength) + { + rv = -uavcan::ErrInvalidConfiguration; + } } } return rv;