commit 3516186e4c607c8e6ff84751b639fca2e05042d2
parent 9e8a7ac61652d4cbe393701f1e15ee77c79a3466
Author: sin <sin@2f30.org>
Date: Fri, 16 Aug 2013 15:53:07 +0100
No need to keep a tm pointer around
Diffstat:
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git 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;