X-Git-Url: https://yaffs.net/gitweb/?a=blobdiff_plain;f=direct%2Fyaffsfs.c;h=6d97cbf4c3f85c5ece16b5e6b9ea45aa5ab8aea4;hb=refs%2Fheads%2Fblock-refreshing;hp=69cf0a48ad9e424d7fc53890683cc1af61682e87;hpb=dba051c0183a6ce9f1af61f9ec2b0f09419e48da;p=yaffs2.git diff --git a/direct/yaffsfs.c b/direct/yaffsfs.c index 69cf0a4..6d97cbf 100644 --- a/direct/yaffsfs.c +++ b/direct/yaffsfs.c @@ -1855,7 +1855,6 @@ static int yaffsfs_DoUtime(struct yaffs_obj *obj, const struct yaffs_utimbuf *buf) { int retVal = -1; - struct yaffs_utimbuf local; obj = yaffs_get_equivalent_obj(obj); @@ -1865,20 +1864,24 @@ static int yaffsfs_DoUtime(struct yaffs_obj *obj, } #if !CONFIG_YAFFS_WINCE - if (!buf) { - local.actime = Y_CURRENT_TIME; - local.modtime = local.actime; - buf = &local; - } + { + struct yaffs_utimbuf local; - if (obj) { - int result; + if (!buf) { + local.actime = Y_CURRENT_TIME; + local.modtime = local.actime; + buf = &local; + } - obj->yst_atime = buf->actime; - obj->yst_mtime = buf->modtime; - obj->dirty = 1; - result = yaffs_flush_file(obj, 0, 0, 0); - retVal = result == YAFFS_OK ? 0 : -1; + if (obj) { + int result; + + obj->yst_atime = buf->actime; + obj->yst_mtime = buf->modtime; + obj->dirty = 1; + result = yaffs_flush_file(obj, 0, 0, 0); + retVal = result == YAFFS_OK ? 0 : -1; + } } #endif