Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lizhongxiao
OpenXG-RAN
Commits
b1df028c
Commit
b1df028c
authored
Jun 18, 2021
by
hardy
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/fix-check' into integration_2021_wk24
parents
569dfb14
2a6ebaaa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
common/utils/system.c
common/utils/system.c
+9
-9
No files found.
common/utils/system.c
View file @
b1df028c
...
@@ -96,14 +96,14 @@ static void read_pipe(int p, char *b, int size) {
...
@@ -96,14 +96,14 @@ static void read_pipe(int p, char *b, int size) {
}
}
}
}
static
int
baseRunTimeCommand
(
char
*
cmd
)
{
static
int
baseRunTimeCommand
(
char
*
cmd
,
size_t
cmdSize
)
{
FILE
*
fp
;
FILE
*
fp
;
size_t
retSize
=
0
;
size_t
retSize
=
0
;
fp
=
popen
(
cmd
,
"r"
);
fp
=
popen
(
cmd
,
"r"
);
memset
(
cmd
,
1
,
sizeof
(
*
cmd
)
);
memset
(
cmd
,
0
,
cmdSize
);
retSize
=
fread
(
cmd
,
1
,
sizeof
(
*
cmd
)
,
fp
);
retSize
=
fread
(
cmd
,
1
,
cmdSize
,
fp
);
fclose
(
fp
);
fclose
(
fp
);
if
(
retSize
==
0
)
{
if
(
retSize
==
0
)
{
...
@@ -115,26 +115,26 @@ static int baseRunTimeCommand(char* cmd) {
...
@@ -115,26 +115,26 @@ static int baseRunTimeCommand(char* cmd) {
int
checkIfFedoraDistribution
(
void
)
{
int
checkIfFedoraDistribution
(
void
)
{
char
cmd
[
200
];
char
cmd
[
200
];
memset
(
cmd
,
1
,
200
);
memset
(
cmd
,
0
,
200
);
sprintf
(
cmd
,
"cat /etc/os-release | grep ID_LIKE | grep -ic fedora || true"
);
sprintf
(
cmd
,
"cat /etc/os-release | grep ID_LIKE | grep -ic fedora || true"
);
return
baseRunTimeCommand
(
cmd
);
return
baseRunTimeCommand
(
cmd
,
200
);
}
}
int
checkIfGenericKernelOnFedora
(
void
)
{
int
checkIfGenericKernelOnFedora
(
void
)
{
char
cmd
[
200
];
char
cmd
[
200
];
memset
(
cmd
,
1
,
200
);
memset
(
cmd
,
0
,
200
);
sprintf
(
cmd
,
"uname -a | grep -c rt || true"
);
sprintf
(
cmd
,
"uname -a | grep -c rt || true"
);
return
(
1
-
baseRunTimeCommand
(
cmd
));
return
(
1
-
baseRunTimeCommand
(
cmd
,
200
));
}
}
int
checkIfInsideContainer
(
void
)
{
int
checkIfInsideContainer
(
void
)
{
char
cmd
[
200
];
char
cmd
[
200
];
int
res
=
0
;
int
res
=
0
;
memset
(
cmd
,
1
,
200
);
memset
(
cmd
,
0
,
200
);
sprintf
(
cmd
,
"cat /proc/self/cgroup | egrep -c 'libpod|podman|kubepods' || true"
);
sprintf
(
cmd
,
"cat /proc/self/cgroup | egrep -c 'libpod|podman|kubepods' || true"
);
res
=
baseRunTimeCommand
(
cmd
);
res
=
baseRunTimeCommand
(
cmd
,
200
);
if
(
res
>
0
)
if
(
res
>
0
)
return
1
;
return
1
;
else
else
...
...
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