From dce360ba2c7b53c60ce7139650bd6b2bab150d08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Fri, 8 Jan 2016 13:22:23 +0000 Subject: [PATCH] [FATFS]: When creating a directory (or setting the volume label), the create time should be set correctly. svn path=/trunk/; revision=70547 --- reactos/tools/fatten/fatfs/ff.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/reactos/tools/fatten/fatfs/ff.c b/reactos/tools/fatten/fatfs/ff.c index 8659d174452..9c84928d994 100644 --- a/reactos/tools/fatten/fatfs/ff.c +++ b/reactos/tools/fatten/fatfs/ff.c @@ -3626,6 +3626,7 @@ FRESULT f_mkdir ( mem_set(dir + DIR_Name, ' ', 11); /* Create "." entry */ dir[DIR_Name] = '.'; dir[DIR_Attr] = AM_DIR; + ST_DWORD(dir + DIR_CrtTime, tm); ST_DWORD(dir + DIR_WrtTime, tm); st_clust(dir, dcl); mem_cpy(dir + SZ_DIRE, dir, SZ_DIRE); /* Create ".." entry */ @@ -3647,7 +3648,8 @@ FRESULT f_mkdir ( } else { dir = dj.dir; dir[DIR_Attr] = AM_DIR; /* Attribute */ - ST_DWORD(dir + DIR_WrtTime, tm); /* Created time */ + ST_DWORD(dir + DIR_CrtTime, tm); /* Created time */ + ST_DWORD(dir + DIR_WrtTime, tm); /* Modified time */ st_clust(dir, dcl); /* Table start cluster */ dj.fs->wflag = 1; res = sync_fs(dj.fs); @@ -3959,6 +3961,7 @@ FRESULT f_setlabel ( if (vn[0]) { mem_cpy(dj.dir, vn, 11); /* Change the volume label name */ tm = GET_FATTIME(); + ST_DWORD(dj.dir + DIR_CrtTime, tm); ST_DWORD(dj.dir + DIR_WrtTime, tm); } else { dj.dir[0] = DDEM; /* Remove the volume label */ @@ -3975,6 +3978,7 @@ FRESULT f_setlabel ( mem_cpy(dj.dir, vn, 11); dj.dir[DIR_Attr] = AM_VOL; tm = GET_FATTIME(); + ST_DWORD(dj.dir + DIR_CrtTime, tm); ST_DWORD(dj.dir + DIR_WrtTime, tm); dj.fs->wflag = 1; res = sync_fs(dj.fs);