mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-13 07:03:34 +08:00
Style fixes in uavcan_posix/dynamic_node_id_server
This commit is contained in:
+3
-3
@@ -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;
|
||||
|
||||
+2
-1
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user