Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
htop
Commits
03e0a73d
Commit
03e0a73d
authored
Aug 19, 2018
by
multiplexd
Committed by
Hisham Muhammad
Aug 24, 2018
Browse files
OpenBSD: make the STARTTIME column display correctly (#815)
parent
794419e6
Changes
1
Hide whitespace changes
Inline
Side-by-side
openbsd/OpenBSDProcessList.c
View file @
03e0a73d
...
@@ -223,6 +223,8 @@ void ProcessList_goThroughEntries(ProcessList* this) {
...
@@ -223,6 +223,8 @@ void ProcessList_goThroughEntries(ProcessList* this) {
bool
preExisting
;
bool
preExisting
;
Process
*
proc
;
Process
*
proc
;
OpenBSDProcess
*
fp
;
OpenBSDProcess
*
fp
;
struct
tm
date
;
struct
timeval
tv
;
int
count
=
0
;
int
count
=
0
;
int
i
;
int
i
;
...
@@ -232,6 +234,8 @@ void ProcessList_goThroughEntries(ProcessList* this) {
...
@@ -232,6 +234,8 @@ void ProcessList_goThroughEntries(ProcessList* this) {
struct
kinfo_proc
*
kprocs
=
kvm_getprocs
(
opl
->
kd
,
KERN_PROC_ALL
,
0
,
sizeof
(
struct
kinfo_proc
),
&
count
);
struct
kinfo_proc
*
kprocs
=
kvm_getprocs
(
opl
->
kd
,
KERN_PROC_ALL
,
0
,
sizeof
(
struct
kinfo_proc
),
&
count
);
//struct kinfo_proc* kprocs = getprocs(KERN_PROC_ALL, 0, &count);
//struct kinfo_proc* kprocs = getprocs(KERN_PROC_ALL, 0, &count);
gettimeofday
(
&
tv
,
NULL
);
for
(
i
=
0
;
i
<
count
;
i
++
)
{
for
(
i
=
0
;
i
<
count
;
i
++
)
{
kproc
=
&
kprocs
[
i
];
kproc
=
&
kprocs
[
i
];
...
@@ -254,6 +258,8 @@ void ProcessList_goThroughEntries(ProcessList* this) {
...
@@ -254,6 +258,8 @@ void ProcessList_goThroughEntries(ProcessList* this) {
proc
->
user
=
UsersTable_getRef
(
this
->
usersTable
,
proc
->
st_uid
);
proc
->
user
=
UsersTable_getRef
(
this
->
usersTable
,
proc
->
st_uid
);
ProcessList_add
((
ProcessList
*
)
this
,
proc
);
ProcessList_add
((
ProcessList
*
)
this
,
proc
);
proc
->
comm
=
OpenBSDProcessList_readProcessName
(
opl
->
kd
,
kproc
,
&
proc
->
basenameOffset
);
proc
->
comm
=
OpenBSDProcessList_readProcessName
(
opl
->
kd
,
kproc
,
&
proc
->
basenameOffset
);
(
void
)
localtime_r
((
time_t
*
)
&
kproc
->
p_ustart_sec
,
&
date
);
strftime
(
proc
->
starttime_show
,
7
,
((
proc
->
starttime_ctime
>
tv
.
tv_sec
-
86400
)
?
"%R "
:
"%b%d "
),
&
date
);
}
else
{
}
else
{
if
(
settings
->
updateProcessNames
)
{
if
(
settings
->
updateProcessNames
)
{
free
(
proc
->
comm
);
free
(
proc
->
comm
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment