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.
This commit is contained in:
Evgeniy Ivanov
2011-07-15 14:21:05 +00:00
committed by Thomas Veerman
parent 902e0e27e0
commit 255ae85b1e
3 changed files with 16 additions and 3 deletions
+2
View File
@@ -563,6 +563,8 @@ off_t newsize; /* inode must become this size */
return(EINVAL);
if (newsize > rip->i_sp->s_max_size) /* don't let inode grow too big */
return(EFBIG);
if (rip->i_size == newsize)
return(OK);
/* Free the actual space if truncating. */
if (newsize < rip->i_size) {