[rtems commit] dosfs: Fix fat_file_update()

Sebastian Huber sebh at rtems.org
Wed Sep 6 12:40:05 UTC 2017


Module:    rtems
Branch:    master
Commit:    4d495cfd014687fa68b17643407f3c64eb890b4f
Changeset: http://git.rtems.org/rtems/commit/?id=4d495cfd014687fa68b17643407f3c64eb890b4f

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Wed Sep  6 14:30:00 2017 +0200

dosfs: Fix fat_file_update()

Do not update the non-existant meta-data of the root directory.

Update #2944.

---

 cpukit/libfs/src/dosfs/fat_file.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/cpukit/libfs/src/dosfs/fat_file.c b/cpukit/libfs/src/dosfs/fat_file.c
index c65c758..e7f593e 100644
--- a/cpukit/libfs/src/dosfs/fat_file.c
+++ b/cpukit/libfs/src/dosfs/fat_file.c
@@ -168,11 +168,9 @@ fat_file_update(fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd)
 {
     int ret_rc = RC_OK;
 
-    /*
-     * if fat-file descriptor is not marked as "removed", synchronize
-     * size, first cluster number, write time and date fields of the file
-     */
-    if (!FAT_FILE_IS_REMOVED(fat_fd) && FAT_FILE_HAS_META_DATA_CHANGED(fat_fd))
+    if (!FAT_FILE_IS_REMOVED(fat_fd) &&
+        FAT_FILE_HAS_META_DATA_CHANGED(fat_fd) &&
+        !FAT_FD_OF_ROOT_DIR(fat_fd))
     {
         int rc;
 



More information about the vc mailing list