mirror of
https://github.com/apache/nuttx.git
synced 2026-05-27 19:36:35 +08:00
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:
committed by
Xiang Xiao
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
Reference in New Issue
Block a user