mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-09 23:00:07 +00:00
hurd: Make O_TRUNC update mtime/ctime
* hurd/lookup-retry.c (__hurd_file_name_lookup_retry): Call __file_utimens after __file_set_size.
This commit is contained in:
parent
a1a486d70e
commit
e095db0bc6
@ -178,8 +178,17 @@ __hurd_file_name_lookup_retry (error_t (*use_init_port)
|
||||
/* We got a successful translation. Now apply any open-time
|
||||
action flags we were passed. */
|
||||
|
||||
if (!err && (flags & O_TRUNC)) /* Asked to truncate the file. */
|
||||
err = __file_set_size (*result, 0);
|
||||
if (!err && (flags & O_TRUNC))
|
||||
{
|
||||
/* Asked to truncate the file. */
|
||||
err = __file_set_size (*result, 0);
|
||||
if (!err)
|
||||
{
|
||||
struct timespec atime = { 0, UTIME_OMIT };
|
||||
struct timespec mtime = { 0, UTIME_NOW };
|
||||
__file_utimens (*result, atime, mtime);
|
||||
}
|
||||
}
|
||||
|
||||
if (err)
|
||||
__mach_port_deallocate (__mach_task_self (), *result);
|
||||
|
Loading…
Reference in New Issue
Block a user