]> granicus.if.org Git - strace/commitdiff
utimes.c: introduce do_utimensat
authorDmitry V. Levin <ldv@altlinux.org>
Sat, 4 May 2019 23:15:52 +0000 (23:15 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sat, 4 May 2019 23:15:52 +0000 (23:15 +0000)
This is going to be used to implement a parser of utimensat_time64
syscall.

* utimes.c (do_utimensat): New function.
(SYS_FUNC(utimensat)): Turn into a thin wrapper around do_utimensat.

utimes.c

index 6656491ac994b40040dc868c22cca9d01a315cee..5dd98a12138327b3beaf3550cc47449c275eff4d 100644 (file)
--- a/utimes.c
+++ b/utimes.c
@@ -33,18 +33,24 @@ SYS_FUNC(futimesat)
        return RVAL_DECODED;
 }
 
-SYS_FUNC(utimensat)
+static int
+do_utimensat(struct tcb *const tcp, const print_obj_by_addr_fn print_ts)
 {
        print_dirfd(tcp, tcp->u_arg[0]);
        printpath(tcp, tcp->u_arg[1]);
        tprints(", ");
-       print_timespec_utime_pair(tcp, tcp->u_arg[2]);
+       print_ts(tcp, tcp->u_arg[2]);
        tprints(", ");
        printflags(at_flags, tcp->u_arg[3], "AT_???");
 
        return RVAL_DECODED;
 }
 
+SYS_FUNC(utimensat)
+{
+       return do_utimensat(tcp, print_timespec_utime_pair);
+}
+
 #ifdef ALPHA
 SYS_FUNC(osf_utimes)
 {