mirror of
git://sourceware.org/git/glibc.git
synced 2025-03-06 20:58:33 +01:00
hurd: Accept null arguments for utimensat pathname
This follows Linux' behavior, making it a replacement for the futimens interface.
This commit is contained in:
parent
fb1059d42a
commit
75fed76dfd
1 changed files with 11 additions and 5 deletions
|
@ -33,13 +33,19 @@ utimensat (int fd, const char *file, const struct timespec tsp[2],
|
|||
error_t err;
|
||||
file_t port;
|
||||
|
||||
port = __file_name_lookup_at (fd, flags, file, 0, 0);
|
||||
if (port == MACH_PORT_NULL)
|
||||
return -1;
|
||||
if (file)
|
||||
{
|
||||
port = __file_name_lookup_at (fd, flags, file, 0, 0);
|
||||
if (port == MACH_PORT_NULL)
|
||||
return -1;
|
||||
|
||||
err = hurd_futimens (port, tsp);
|
||||
err = hurd_futimens (port, tsp);
|
||||
|
||||
__mach_port_deallocate (__mach_task_self (), port);
|
||||
}
|
||||
else
|
||||
err = HURD_DPORT_USE (fd, hurd_futimens (port, tsp));
|
||||
|
||||
__mach_port_deallocate (__mach_task_self (), port);
|
||||
if (err)
|
||||
return __hurd_fail (err);
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue