From 3516186e4c607c8e6ff84751b639fca2e05042d2 Mon Sep 17 00:00:00 2001 From: sin Date: Fri, 16 Aug 2013 15:53:07 +0100 Subject: [PATCH] No need to keep a tm pointer around --- ps.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ps.c b/ps.c index f6b011e..f196440 100644 --- a/ps.c +++ b/ps.c @@ -70,9 +70,8 @@ psout(struct procstat *ps) int tty_maj, tty_min; uid_t myeuid, peuid, puid; unsigned sut; - struct sysinfo info; - struct tm *tm; time_t start; + struct sysinfo info; struct passwd *pw; /* Ignore session leaders */ @@ -126,9 +125,8 @@ psout(struct procstat *ps) eprintf("sysinfo:"); start = time(NULL) - info.uptime; start += (ps->starttime / sysconf(_SC_CLK_TCK)); - tm = localtime(&start); strftime(stimestr, sizeof(stimestr), - "%H:%M", tm); + "%H:%M", localtime(&start)); if (parsecmdline(ps->pid, cmdline, sizeof(cmdline)) < 0) cmd = ps->comm;