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
bae27054
Commit
bae27054
authored
Aug 24, 2018
by
Hisham Muhammad
Browse files
Linux: fix CPU count
parent
8d01ae20
Changes
1
Hide whitespace changes
Inline
Side-by-side
linux/LinuxProcessList.c
View file @
bae27054
...
@@ -245,7 +245,7 @@ ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, ui
...
@@ -245,7 +245,7 @@ ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, ui
if
(
file
==
NULL
)
{
if
(
file
==
NULL
)
{
CRT_fatalError
(
"Cannot open "
PROCSTATFILE
);
CRT_fatalError
(
"Cannot open "
PROCSTATFILE
);
}
}
int
cpus
=
-
1
;
int
cpus
=
0
;
do
{
do
{
char
buffer
[
PROC_LINE_LENGTH
+
1
];
char
buffer
[
PROC_LINE_LENGTH
+
1
];
if
(
fgets
(
buffer
,
PROC_LINE_LENGTH
+
1
,
file
)
==
NULL
)
{
if
(
fgets
(
buffer
,
PROC_LINE_LENGTH
+
1
,
file
)
==
NULL
)
{
...
...
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