[PATCH] sparce: fix building with optimizations

Mike Frysinger vapier at gentoo.org
Sat Apr 19 20:28:10 UTC 2008


The sprinttime() function takes a time_t which represents the time (in
seconds), but currently it isn't given a time_t.  The time members of the
solstatbuf are the time (in seconds) as well as nanosecond granularity.
Since sprinttime() doesn't include nanosecond granularity, we don't care
about that part of the time.

Signed-off-by: Mike Frysinger <vapier at gentoo.org>
---
 file.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/file.c b/file.c
index 6388faa..80593b0 100644
--- a/file.c
+++ b/file.c
@@ -769,9 +769,9 @@ long addr;
 		break;
 	}
 	if (!abbrev(tcp)) {
-		tprintf("st_atime=%s, ", sprinttime(statbuf.st_atime));
-		tprintf("st_mtime=%s, ", sprinttime(statbuf.st_mtime));
-		tprintf("st_ctime=%s}", sprinttime(statbuf.st_ctime));
+		tprintf("st_atime=%s, ", sprinttime(statbuf.st_atime.tv_sec));
+		tprintf("st_mtime=%s, ", sprinttime(statbuf.st_mtime.tv_sec));
+		tprintf("st_ctime=%s}", sprinttime(statbuf.st_ctime.tv_sec));
 	}
 	else
 		tprintf("...}");
-- 
1.5.5





More information about the Strace-devel mailing list