No need to keep a tm pointer around
This commit is contained in:
parent
9e8a7ac616
commit
3516186e4c
6
ps.c
6
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;
|
||||
|
Loading…
Reference in New Issue
Block a user