Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
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
0505a7cf
Commit
0505a7cf
authored
7 years ago
by
pmalhaire
Committed by
Hisham Muhammad
7 years ago
Browse files
Options
Download
Email Patches
Plain Diff
macOS: fix the switched version test (#772)
parent
cf04300d
master
pkgconfig-on-linux
2.2.0
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
darwin/DarwinProcessList.c
+8
-3
darwin/DarwinProcessList.c
with
8 additions
and
3 deletions
+8
-3
darwin/DarwinProcessList.c
View file @
0505a7cf
...
...
@@ -38,12 +38,17 @@ void GetKernelVersion(struct kern *k) {
memcpy
(
k
->
version
,
version_
,
sizeof
(
version_
));
}
/* compare the given os version with the one installed returns:
0 if equals the installed version
positive value if less than the installed version
negative value if more than the installed version
*/
int
CompareKernelVersion
(
short
int
major
,
short
int
minor
,
short
int
component
)
{
struct
kern
k
;
GetKernelVersion
(
&
k
);
if
(
k
.
version
[
0
]
!=
major
)
return
major
-
k
.
version
[
0
];
if
(
k
.
version
[
1
]
!=
minor
)
return
minor
-
k
.
version
[
1
];
if
(
k
.
version
[
2
]
!=
component
)
return
component
-
k
.
version
[
2
];
if
(
k
.
version
[
0
]
!=
major
)
return
k
.
version
[
0
]
-
major
;
if
(
k
.
version
[
1
]
!=
minor
)
return
k
.
version
[
1
]
-
minor
;
if
(
k
.
version
[
2
]
!=
component
)
return
k
.
version
[
2
]
-
component
;
return
0
;
}
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Projects
Groups
Snippets
Help