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:
committed by
Thomas Veerman
parent
902e0e27e0
commit
255ae85b1e
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user