From d677e6300867fd9ce04fead8bf783812a1f9442b Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 13 Feb 2017 15:33:52 -0600 Subject: [PATCH] ROMFS: Back out 29028bcd5aab37e11eb6c7a2bd76e378504b8264. A cool idea, but loses the EXECUTABLE bit in the file type. --- fs/romfs/fs_romfs.c | 3 ++- fs/romfs/fs_romfs.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/romfs/fs_romfs.c b/fs/romfs/fs_romfs.c index 354c603b706..f71425df330 100644 --- a/fs/romfs/fs_romfs.c +++ b/fs/romfs/fs_romfs.c @@ -256,6 +256,7 @@ static int romfs_open(FAR struct file *filep, FAR const char *relpath, */ rf->rf_size = dirinfo.rd_size; + rf->rf_type = (uint8_t)(dirinfo.rd_next & RFNEXT_ALLMODEMASK); /* Get the start of the file data */ @@ -737,7 +738,7 @@ static int romfs_fstat(FAR const struct file *filep, FAR struct stat *buf) { /* Return information about the directory entry */ - ret = romfs_stat_common(RFNEXT_FILE, rf->rf_size, + ret = romfs_stat_common(rf->rf_type, rf->rf_size, rm->rm_hwsectorsize, buf); } diff --git a/fs/romfs/fs_romfs.h b/fs/romfs/fs_romfs.h index 12ab8d88239..336e0efaf65 100644 --- a/fs/romfs/fs_romfs.h +++ b/fs/romfs/fs_romfs.h @@ -158,11 +158,12 @@ struct romfs_mountpt_s struct romfs_file_s { - struct romfs_file_s *rf_next; /* Retained in a singly linked list */ + FAR struct romfs_file_s *rf_next; /* Retained in a singly linked list */ uint32_t rf_startoffset; /* Offset to the start of the file data */ uint32_t rf_size; /* Size of the file in bytes */ uint32_t rf_cachesector; /* Current sector in the rf_buffer */ uint8_t *rf_buffer; /* File sector buffer, allocated if rm_xipbase==0 */ + uint8_t rf_type; /* File type (for fstat()) */ }; /* This structure is used internally for describing the result of