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
1e124da0
Commit
1e124da0
authored
Oct 16, 2009
by
Hisham Muhammad
Browse files
coverity fixes
parent
dd86b9b6
Changes
2
Hide whitespace changes
Inline
Side-by-side
ProcessList.c
View file @
1e124da0
...
@@ -313,7 +313,7 @@ static void ProcessList_remove(ProcessList* this, Process* p) {
...
@@ -313,7 +313,7 @@ static void ProcessList_remove(ProcessList* this, Process* p) {
unsigned
int
pid
=
p
->
pid
;
unsigned
int
pid
=
p
->
pid
;
int
index
=
Vector_indexOf
(
this
->
processes
,
p
,
Process_pidCompare
);
int
index
=
Vector_indexOf
(
this
->
processes
,
p
,
Process_pidCompare
);
assert
(
index
!=
-
1
);
assert
(
index
!=
-
1
);
Vector_remove
(
this
->
processes
,
index
);
if
(
index
>=
0
)
Vector_remove
(
this
->
processes
,
index
);
assert
(
Hashtable_get
(
this
->
processTable
,
pid
)
==
NULL
);
(
void
)
pid
;
assert
(
Hashtable_get
(
this
->
processTable
,
pid
)
==
NULL
);
(
void
)
pid
;
assert
(
Hashtable_count
(
this
->
processTable
)
==
Vector_count
(
this
->
processes
));
assert
(
Hashtable_count
(
this
->
processTable
)
==
Vector_count
(
this
->
processes
));
}
}
...
@@ -730,7 +730,7 @@ static bool ProcessList_processEntries(ProcessList* this, char* dirname, Process
...
@@ -730,7 +730,7 @@ static bool ProcessList_processEntries(ProcessList* this, char* dirname, Process
void
ProcessList_scan
(
ProcessList
*
this
)
{
void
ProcessList_scan
(
ProcessList
*
this
)
{
unsigned
long
long
int
usertime
,
nicetime
,
systemtime
,
systemalltime
,
idlealltime
,
idletime
,
totaltime
;
unsigned
long
long
int
usertime
,
nicetime
,
systemtime
,
systemalltime
,
idlealltime
,
idletime
,
totaltime
;
unsigned
long
long
int
swapFree
;
unsigned
long
long
int
swapFree
=
0
;
FILE
*
status
;
FILE
*
status
;
char
buffer
[
128
];
char
buffer
[
128
];
...
...
UptimeMeter.c
View file @
1e124da0
...
@@ -19,7 +19,7 @@ int UptimeMeter_attributes[] = {
...
@@ -19,7 +19,7 @@ int UptimeMeter_attributes[] = {
};
};
static
void
UptimeMeter_setValues
(
Meter
*
this
,
char
*
buffer
,
int
len
)
{
static
void
UptimeMeter_setValues
(
Meter
*
this
,
char
*
buffer
,
int
len
)
{
double
uptime
;
double
uptime
=
0
;
FILE
*
fd
=
fopen
(
PROCDIR
"/uptime"
,
"r"
);
FILE
*
fd
=
fopen
(
PROCDIR
"/uptime"
,
"r"
);
fscanf
(
fd
,
"%lf"
,
&
uptime
);
fscanf
(
fd
,
"%lf"
,
&
uptime
);
fclose
(
fd
);
fclose
(
fd
);
...
...
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