mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-18 06:38:29 -04:00
AP_Filesystem: fixed stat call for @SYS files
This commit is contained in:
parent
c787231435
commit
02e9519ab0
@ -226,7 +226,11 @@ int AP_Filesystem_Sys::stat(const char *pathname, struct stat *stbuf)
|
|||||||
stbuf->st_size = 0; // just a placeholder value
|
stbuf->st_size = 0; // just a placeholder value
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
int8_t pos = file_in_sysfs(&pathname[1]);
|
const char *pathname_noslash = pathname;
|
||||||
|
if (pathname[0] == '/') {
|
||||||
|
pathname_noslash = &pathname[1];
|
||||||
|
}
|
||||||
|
int8_t pos = file_in_sysfs(pathname_noslash);
|
||||||
if (pos < 0) {
|
if (pos < 0) {
|
||||||
errno = ENOENT;
|
errno = ENOENT;
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
Reference in New Issue
Block a user