mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
Added FileNotFound error code according to new Mavlink FTP specification
This commit is contained in:
parent
116de6d25f
commit
ef865a091f
@ -269,6 +269,8 @@ out:
|
||||
|
||||
if (r_errno == EEXIST) {
|
||||
errorCode = kErrFailFileExists;
|
||||
} else if (r_errno == ENOENT) {
|
||||
errorCode = kErrFileNotFound;
|
||||
}
|
||||
|
||||
payload->data[0] = errorCode;
|
||||
@ -350,9 +352,7 @@ MavlinkFTP::_workList(PayloadHeader *payload, bool list_hidden)
|
||||
|
||||
if (dp == nullptr) {
|
||||
PX4_WARN("File open failed %s", _work_buffer1);
|
||||
// this is not an FTP error, abort directory by setting errno to ENOENT "No such file or directory"
|
||||
errno = ENOENT;
|
||||
return kErrFailErrno;
|
||||
return kErrFileNotFound;
|
||||
}
|
||||
|
||||
#ifdef MAVLINK_FTP_DEBUG
|
||||
|
||||
@ -119,8 +119,9 @@ public:
|
||||
kErrNoSessionsAvailable, ///< All available Sessions in use
|
||||
kErrEOF, ///< Offset past end of file for List and Read commands
|
||||
kErrUnknownCommand, ///< Unknown command opcode
|
||||
kErrFailFileExists, ///< File exists already
|
||||
kErrFailFileProtected ///< File is write protected
|
||||
kErrFailFileExists, ///< File/directory exists already
|
||||
kErrFailFileProtected, ///< File/directory is write protected
|
||||
kErrFileNotFound ///< File/directory not found
|
||||
};
|
||||
|
||||
unsigned get_size();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user