[PATCH] fix UTIME_NOW/UTIME_OMIT

Elliott Hughes enh at google.com
Tue Dec 23 18:42:40 UTC 2014


The kernel doesn't actually care what tv_sec is set to --- it only checks
tv_nsec when looking for the special values.

diff --git a/time.c b/time.c
index 1ad90d9..5bc5af1 100644
--- a/time.c
+++ b/time.c
@@ -87,7 +87,7 @@ sprinttv(char *buf, struct tcb *tcp, long addr, enum bitness_t bitness, int spec
 
 		rc = umove(tcp, addr, &tv);
 		if (rc >= 0) {
-			if (special && tv.tv_sec == 0) {
+			if (special) {
 				if (tv.tv_usec == UTIME_NOW)
 					return stpcpy(buf, "UTIME_NOW");
 				if (tv.tv_usec == UTIME_OMIT)
@@ -101,7 +101,7 @@ sprinttv(char *buf, struct tcb *tcp, long addr, enum bitness_t bitness, int spec
 
 		rc = umove(tcp, addr, &tv);
 		if (rc >= 0) {
-			if (special && tv.tv_sec == 0) {
+			if (special) {
 				if (tv.tv_usec == UTIME_NOW)
 					return stpcpy(buf, "UTIME_NOW");
 				if (tv.tv_usec == UTIME_OMIT)




More information about the Strace-devel mailing list