Changeset c5b2d79 in rtems


Ignore:
Timestamp:
Sep 13, 2013, 1:17:57 PM (6 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
736983f1
Parents:
f82851c5
git-author:
Sebastian Huber <sebastian.huber@…> (09/13/13 13:17:57)
git-committer:
Sebastian Huber <sebastian.huber@…> (09/13/13 14:47:55)
Message:

IMFS: Fix truncate according to POSIX

ftruncate() and open() with O_TRUNC shall upon successful completion
mark for update the st_ctime and st_mtime fields of the file.

truncate() shall upon successful completion, if the file size is
changed, mark for update the st_ctime and st_mtime fields of the file.

The POSIX standard "The Open Group Base Specifications Issue 7", IEEE
Std 1003.1, 2013 Edition says nothing about the behaviour of truncate()
if the file size remains unchanged.

Future directions of the standard may mandate the behaviour specified in
ftruncate():

http://austingroupbugs.net/view.php?id=489

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libfs/src/imfs/memfile.c

    rf82851c5 rc5b2d79  
    175175  the_jnode->info.file.size = length;
    176176
    177   IMFS_update_atime( the_jnode );
     177  IMFS_mtime_ctime_update(the_jnode);
    178178
    179179  return 0;
     
    249249  the_jnode->info.file.size = new_length;
    250250
    251   IMFS_update_ctime(the_jnode);
    252   IMFS_update_mtime(the_jnode);
     251  IMFS_mtime_ctime_update(the_jnode);
    253252  return 0;
    254253}
Note: See TracChangeset for help on using the changeset viewer.