No need to keep a tm pointer around

This commit is contained in:
sin 2013-08-16 15:53:07 +01:00
parent 9e8a7ac616
commit 3516186e4c
1 changed files with 2 additions and 4 deletions

6
ps.c
View File

@ -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;