Commit graph

6 commits

Author SHA1 Message Date
David van Moolenbroek 26f817243b VFS: reimplement truncate mtime/ctime fix
POSIX mandates that a file's modification and change time be left
untouched upon truncate/ftruncate iff the file size does not change.
However, an open(O_TRUNC) call must always update the modification and
change time of the file, even if it was already zero-sized. VFS uses
the file systems' truncate call to implement O_TRUNC. This patch
replaces git-255ae85, which did not take into account the open case.
The size check is now moved into VFS, so that individual file systems
need not check for this case anymore.
2012-04-20 11:35:59 +02:00
Ben Gras 6a73e85ad1 retire _PROTOTYPE
. only good for obsolete K&R support
	. also remove a stray ansi.h and the proto cmd
2012-03-25 16:17:10 +02:00
Thomas Veerman 3fb6c995e0 Make all tests use common.c
This will make sure that all file descriptors are closed through
the use of the start() function.
2011-12-21 12:59:22 +00:00
Evgeniy Ivanov 255ae85b1e Fix time modification on truncate()
POSIX truncate specification says "Upon successful completion, if
the *file size is changed*, this function shall mark for update the
st_ctime and st_mtime fields of the file." This patch prevents
changing of the date fields when the size stays the same.
2011-07-15 14:21:05 +00:00
Ben Gras a17d7c827b Al's no-double-empty-lines crusade 2005-08-22 15:08:27 +00:00
Ben Gras 9865aeaa79 Initial revision 2005-04-21 14:53:53 +00:00