2007-09-22 Dmitry V. Levin <ldv@altlinux.org>
* time.c (print_timespec, sprint_timespec): New functions.
* defs.h (print_timespec, sprint_timespec): Declare them.
* desc.c (sys_io_getevents): Use print_timespec.
* stream.c (sys_ppoll): Likewise.
(decode_poll): Use sprint_timespec.
diff --git a/stream.c b/stream.c
index dfdfdb2..e97392c 100644
--- a/stream.c
+++ b/stream.c
@@ -417,15 +417,10 @@
strcat(outstr, "]");
if (pts) {
- struct timespec ts;
char str[128];
sprintf(str, "%sleft ", cumlen ? ", " : "");
- if (umove(tcp, pts, &ts) == 0)
- sprintf(str + strlen(str), "{%lu, %lu}",
- ts.tv_sec, ts.tv_nsec);
- else
- strcat(str, "{...}");
+ sprint_timespec(str + strlen(str), tcp, pts);
if ((cumlen += strlen(str)) < sizeof(outstr))
strcat(outstr, str);
}
@@ -459,11 +454,8 @@
{
int rc = decode_poll(tcp, tcp->u_arg[2]);
if (entering(tcp)) {
- struct timespec ts;
- if (umove(tcp, tcp->u_arg[2], &ts) == 0)
- tprintf("{%lu, %lu}, ", ts.tv_sec, ts.tv_nsec);
- else
- tprintf("{...}, ");
+ print_timespec(tcp, tcp->u_arg[2]);
+ tprintf(", ");
print_sigset(tcp, tcp->u_arg[3], 0);
tprintf(", %lu", tcp->u_arg[4]);
}