Style fixes in uavcan_posix/dynamic_node_id_server

This commit is contained in:
Pavel Kirienko
2015-05-26 20:36:41 +03:00
parent aafdf81f29
commit 6a34d19cc5
2 changed files with 5 additions and 4 deletions
@@ -54,8 +54,8 @@ protected:
int n = snprintf(buffer, FormatBufferLength, "%ld.%06ld\t%d\t%lld\n",
static_cast<long>(ts.tv_sec), static_cast<long>(ts.tv_nsec / 1000L),
static_cast<int>(code), static_cast<long long>(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;
@@ -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);
}