[PATCH 2/2] Fix old_value argument retrieval in timerfd_settime parser

Eugene Syromyatnikov evgsyr at gmail.com
Mon Aug 22 08:51:16 UTC 2016


This is done similar to timer_settime syscall parser.

* time.c (SYS_FUNC(timerfd_settime)): retrieve old_value argument on
  exiting and not on entering. Return 0 instead of RVAL_DECODED
  (since call hasn't been decoded in full on entering).
---
 time.c |   20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/time.c b/time.c
index 963d0ea..b32eddf 100644
--- a/time.c
+++ b/time.c
@@ -314,15 +314,17 @@ SYS_FUNC(timerfd_create)
 
 SYS_FUNC(timerfd_settime)
 {
-	printfd(tcp, tcp->u_arg[0]);
-	tprints(", ");
-	printflags(timerfdflags, tcp->u_arg[1], "TFD_???");
-	tprints(", ");
-	print_itimerspec(tcp, tcp->u_arg[2]);
-	tprints(", ");
-	print_itimerspec(tcp, tcp->u_arg[3]);
-
-	return RVAL_DECODED;
+	if (entering(tcp)) {
+		printfd(tcp, tcp->u_arg[0]);
+		tprints(", ");
+		printflags(timerfdflags, tcp->u_arg[1], "TFD_???");
+		tprints(", ");
+		print_itimerspec(tcp, tcp->u_arg[2]);
+		tprints(", ");
+	} else {
+		print_itimerspec(tcp, tcp->u_arg[3]);
+	}
+	return 0;
 }
 
 SYS_FUNC(timerfd_gettime)
-- 
1.7.10.4





More information about the Strace-devel mailing list