Previously, sys_futimens() retrieved a reference to the file
descriptor to get a value for the pathname argument. The reference
was not freed afterwards. Since sys_utimensat() has been changed
to accept NULL as pathname and work on dirfd instead, the code
can be removed altogether.
Signed-off-by: Marc Rittinghaus <marc.rittinghaus@unikraft.io>
Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Reviewed-by: Rares Miculescu <miculescur@gmail.com>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #865
int
sys_futimens(int fd, const struct timespec times[2])
{
- int error;
- struct vfscore_file *fp;
- char *pathname;
-
- fp = vfscore_get_file(fd);
- if (!fp)
- return EBADF;
-
- if (!fp->f_dentry)
- return EBADF;
-
- pathname = fp->f_dentry->d_path;
- error = sys_utimensat(AT_FDCWD, pathname, times, 0);
- return error;
+ return sys_utimensat(fd, NULL, times, 0);
}
int