forked from Imagelibrary/rtems
dosfs: Fix warnings
This commit is contained in:
@@ -39,6 +39,7 @@ extern "C" {
|
||||
|
||||
typedef enum {
|
||||
FAT_DIRECTORY = 0,
|
||||
FAT_HARD_LINK = 2, /* pseudo type */
|
||||
FAT_FILE = 4
|
||||
} fat_file_type_t;
|
||||
|
||||
|
||||
@@ -85,13 +85,6 @@ extern const rtems_filesystem_file_handlers_r msdos_file_handlers;
|
||||
* of ticks to help debugging or if you need such a */
|
||||
#define MSDOS_VOLUME_SEMAPHORE_TIMEOUT RTEMS_NO_TIMEOUT
|
||||
|
||||
/* Node types */
|
||||
typedef enum {
|
||||
MSDOS_DIRECTORY = 0,
|
||||
MSDOS_REGULAR_FILE = 4,
|
||||
MSDOS_HARD_LINK = 2 /* pseudo type */
|
||||
} msdos_node_type_t;
|
||||
|
||||
/*
|
||||
* Macros for fetching fields from 32 bytes long FAT Directory Entry
|
||||
* Structure
|
||||
@@ -370,7 +363,7 @@ int msdos_dir_stat(
|
||||
*
|
||||
*/
|
||||
int msdos_creat_node(const rtems_filesystem_location_info_t *parent_loc,
|
||||
msdos_node_type_t type,
|
||||
fat_file_type_t type,
|
||||
const char *name,
|
||||
int name_len,
|
||||
mode_t mode,
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
*/
|
||||
int
|
||||
msdos_creat_node(const rtems_filesystem_location_info_t *parent_loc,
|
||||
msdos_node_type_t type,
|
||||
fat_file_type_t type,
|
||||
const char *name,
|
||||
int name_len,
|
||||
mode_t mode,
|
||||
@@ -115,10 +115,10 @@ msdos_creat_node(const rtems_filesystem_location_info_t *parent_loc,
|
||||
/* initialize directory/file size */
|
||||
*MSDOS_DIR_FILE_SIZE(short_node) = MSDOS_INIT_DIR_SIZE;
|
||||
|
||||
if (type == MSDOS_DIRECTORY) {
|
||||
if (type == FAT_DIRECTORY) {
|
||||
*MSDOS_DIR_ATTR(short_node) |= MSDOS_ATTR_DIRECTORY;
|
||||
}
|
||||
else if (type == MSDOS_HARD_LINK) {
|
||||
else if (type == FAT_HARD_LINK) {
|
||||
/*
|
||||
* when we establish a (temporary) hard link,
|
||||
* we must copy some information from the original
|
||||
@@ -177,7 +177,7 @@ msdos_creat_node(const rtems_filesystem_location_info_t *parent_loc,
|
||||
* if we create a new file we are done, if directory there are more steps
|
||||
* to do
|
||||
*/
|
||||
if (type == MSDOS_DIRECTORY)
|
||||
if (type == FAT_DIRECTORY)
|
||||
{
|
||||
/* open new directory as fat-file */
|
||||
rc = fat_file_open(&fs_info->fat, &dir_pos, &fat_fd);
|
||||
|
||||
@@ -64,7 +64,7 @@ static bool msdos_is_directory(
|
||||
rtems_filesystem_eval_path_get_currentloc( ctx );
|
||||
fat_file_fd_t *fat_fd = currentloc->node_access;
|
||||
|
||||
return fat_fd->fat_file_type == MSDOS_DIRECTORY;
|
||||
return fat_fd->fat_file_type == FAT_DIRECTORY;
|
||||
}
|
||||
|
||||
static rtems_filesystem_eval_path_generic_status msdos_eval_token(
|
||||
|
||||
@@ -43,18 +43,18 @@ int msdos_mknod(
|
||||
)
|
||||
{
|
||||
int rc = RC_OK;
|
||||
msdos_node_type_t type = 0;
|
||||
fat_file_type_t type = 0;
|
||||
|
||||
/*
|
||||
* Figure out what type of msdos node this is.
|
||||
*/
|
||||
if (S_ISDIR(mode))
|
||||
{
|
||||
type = MSDOS_DIRECTORY;
|
||||
type = FAT_DIRECTORY;
|
||||
}
|
||||
else if (S_ISREG(mode))
|
||||
{
|
||||
type = MSDOS_REGULAR_FILE;
|
||||
type = FAT_FILE;
|
||||
}
|
||||
else
|
||||
rtems_set_errno_and_return_minus_one(EINVAL);
|
||||
|
||||
@@ -51,7 +51,7 @@ msdos_rename(
|
||||
* existing file
|
||||
*/
|
||||
rc = msdos_creat_node(new_parent_loc,
|
||||
MSDOS_HARD_LINK,new_name,new_namelen,S_IFREG,
|
||||
FAT_HARD_LINK,new_name,new_namelen,S_IFREG,
|
||||
old_fat_fd);
|
||||
if (rc != RC_OK)
|
||||
{
|
||||
|
||||
@@ -28,7 +28,7 @@ msdos_rmnod(const rtems_filesystem_location_info_t *parent_pathloc,
|
||||
msdos_fs_info_t *fs_info = pathloc->mt_entry->fs_info;
|
||||
fat_file_fd_t *fat_fd = pathloc->node_access;
|
||||
|
||||
if (fat_fd->fat_file_type == MSDOS_DIRECTORY)
|
||||
if (fat_fd->fat_file_type == FAT_FILE)
|
||||
{
|
||||
bool is_empty = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user