mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-22 06:07:35 +08:00
Formated, tested
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user