forked from Imagelibrary/rtems
Filesystem: Delete node type operation
Use the fstat handler instead.
This commit is contained in:
@@ -597,16 +597,18 @@ static int rtems_tfs_ioctl(
|
||||
return(0);
|
||||
}
|
||||
|
||||
static rtems_filesystem_node_types_t rtems_tfs_node_type(
|
||||
const rtems_filesystem_location_info_t *loc
|
||||
static int rtems_tfs_fstat(
|
||||
const rtems_filesystem_location_info_t *loc,
|
||||
struct stat *buf
|
||||
)
|
||||
{
|
||||
const char *path = loc->node_access;
|
||||
size_t pathlen = strlen(path);
|
||||
|
||||
return rtems_tfs_is_directory(path, pathlen) ?
|
||||
RTEMS_FILESYSTEM_DIRECTORY
|
||||
: RTEMS_FILESYSTEM_MEMORY_FILE;
|
||||
buf->st_mode = S_IRWXU | S_IRWXG | S_IRWXO
|
||||
| (rtems_tfs_is_directory(path, pathlen) ? S_IFDIR : S_IFREG);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rtems_tfs_clone_node_info(
|
||||
@@ -646,7 +648,6 @@ static const rtems_filesystem_operations_table rtems_tfs_ops = {
|
||||
.eval_path_h = rtems_tfs_eval_path,
|
||||
.link_h = rtems_filesystem_default_link,
|
||||
.are_nodes_equal_h = rtems_tfs_are_nodes_equal,
|
||||
.node_type_h = rtems_tfs_node_type,
|
||||
.mknod_h = rtems_filesystem_default_mknod,
|
||||
.rmnod_h = rtems_filesystem_default_rmnod,
|
||||
.fchmod_h = rtems_filesystem_default_fchmod,
|
||||
@@ -671,7 +672,7 @@ static const rtems_filesystem_file_handlers_r rtems_tfs_handlers = {
|
||||
.write_h = rtems_tfs_write,
|
||||
.ioctl_h = rtems_tfs_ioctl,
|
||||
.lseek_h = rtems_tfs_lseek,
|
||||
.fstat_h = rtems_filesystem_default_fstat,
|
||||
.fstat_h = rtems_tfs_fstat,
|
||||
.ftruncate_h = rtems_tfs_ftruncate,
|
||||
.fsync_h = rtems_filesystem_default_fsync_or_fdatasync,
|
||||
.fdatasync_h = rtems_filesystem_default_fsync_or_fdatasync,
|
||||
|
||||
Reference in New Issue
Block a user