fs/spiffs: Return OK on spiffs_[f]stat
success
According to the POSIX standard, `fstat` and `stat` should return 0 (`OK`) on success. This commit changed the underlying `spiffs` implementation to follow the POSIX standard.
This commit is contained in:
parent
00ff9ef15c
commit
fe45d8aace
@ -1187,7 +1187,10 @@ static int spiffs_fstat(FAR const struct file *filep, FAR struct stat *buf)
|
|||||||
}
|
}
|
||||||
|
|
||||||
spiffs_unlock_volume(fs);
|
spiffs_unlock_volume(fs);
|
||||||
return spiffs_map_errno(ret);
|
|
||||||
|
ret = spiffs_map_errno(ret);
|
||||||
|
|
||||||
|
return ret >= 0 ? OK : ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@ -1929,7 +1932,8 @@ static int spiffs_stat(FAR struct inode *mountpt, FAR const char *relpath,
|
|||||||
|
|
||||||
errout_with_lock:
|
errout_with_lock:
|
||||||
spiffs_unlock_volume(fs);
|
spiffs_unlock_volume(fs);
|
||||||
return spiffs_map_errno(ret);
|
ret = spiffs_map_errno(ret);
|
||||||
|
return ret >= 0 ? OK : ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
Loading…
Reference in New Issue
Block a user