Added FileNotFound error code according to new Mavlink FTP specification

This commit is contained in:
Matej Frančeškin
2020-03-08 21:43:54 +01:00
committed by Lorenz Meier
parent 116de6d25f
commit ef865a091f
2 changed files with 6 additions and 5 deletions
+3 -3
View File
@@ -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