mirror of
https://sourceware.org/git/glibc.git
synced 2025-10-12 19:04:54 +03: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:
@@ -33,6 +33,8 @@ utimensat (int fd, const char *file, const struct timespec tsp[2],
|
||||
error_t err;
|
||||
file_t port;
|
||||
|
||||
if (file)
|
||||
{
|
||||
port = __file_name_lookup_at (fd, flags, file, 0, 0);
|
||||
if (port == MACH_PORT_NULL)
|
||||
return -1;
|
||||
@@ -40,6 +42,10 @@ utimensat (int fd, const char *file, const struct timespec tsp[2],
|
||||
err = hurd_futimens (port, tsp);
|
||||
|
||||
__mach_port_deallocate (__mach_task_self (), port);
|
||||
}
|
||||
else
|
||||
err = HURD_DPORT_USE (fd, hurd_futimens (port, tsp));
|
||||
|
||||
if (err)
|
||||
return __hurd_fail (err);
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user