fs: littlefs: sample: Generate fname[12] strings after mount
The littlefs_mount() function sets the mount point for block devices, so fname[12] shall be generated after calling it. Signed-off-by: Lukasz Majewski <lukma@denx.de>
This commit is contained in:
parent
2c8a7e7757
commit
d7cd42699b
1 changed files with 3 additions and 3 deletions
|
@ -338,14 +338,14 @@ void main(void)
|
||||||
|
|
||||||
LOG_PRINTK("Sample program to r/w files on littlefs\n");
|
LOG_PRINTK("Sample program to r/w files on littlefs\n");
|
||||||
|
|
||||||
snprintf(fname1, sizeof(fname1), "%s/boot_count", mp->mnt_point);
|
|
||||||
snprintf(fname2, sizeof(fname2), "%s/pattern.bin", mp->mnt_point);
|
|
||||||
|
|
||||||
rc = littlefs_mount(mp);
|
rc = littlefs_mount(mp);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
snprintf(fname1, sizeof(fname1), "%s/boot_count", mp->mnt_point);
|
||||||
|
snprintf(fname2, sizeof(fname2), "%s/pattern.bin", mp->mnt_point);
|
||||||
|
|
||||||
rc = fs_statvfs(mp->mnt_point, &sbuf);
|
rc = fs_statvfs(mp->mnt_point, &sbuf);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
LOG_PRINTK("FAIL: statvfs: %d\n", rc);
|
LOG_PRINTK("FAIL: statvfs: %d\n", rc);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue