From: Timothy Manning Date: Thu, 3 Jun 2021 22:18:59 +0000 (+1200) Subject: Added comments to yaffs_DoUtimre X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=commitdiff_plain;h=fd1de40165e91775b8af30029f8cec198d4ed665 Added comments to yaffs_DoUtimre Signed-off-by: Timothy Manning --- diff --git a/direct/yaffsfs.c b/direct/yaffsfs.c index d1e4e4e..2c1ac42 100644 --- a/direct/yaffsfs.c +++ b/direct/yaffsfs.c @@ -1943,17 +1943,21 @@ static int yaffsfs_DoUtime(struct yaffs_obj *obj, } #if !CONFIG_YAFFS_WINCE + // if the the buffer is null then create one with the fields set to the current time. if (!buf) { local.actime = Y_CURRENT_TIME; local.modtime = local.actime; buf = &local; } + // copy the buffer's time into the obj. if (obj) { int result; obj->yst_atime = buf->actime; obj->yst_mtime = buf->modtime; + + // set the obj to dirty to cause it to be written to flash during the next flush operation. obj->dirty = 1; result = yaffs_flush_file(obj, 0, 0, 0); retVal = result == YAFFS_OK ? 0 : -1;