Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
a48622d8
Unverified
Commit
a48622d8
authored
Jan 20, 2018
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
coverity: #1427668
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
e14d8270
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
lxc_init.c
src/lxc/lxc_init.c
+8
-6
No files found.
src/lxc/lxc_init.c
View file @
a48622d8
...
@@ -76,23 +76,25 @@ static void usage(void) {
...
@@ -76,23 +76,25 @@ static void usage(void) {
static
void
remove_self
(
void
)
static
void
remove_self
(
void
)
{
{
char
path
[
PATH_MAX
]
;
int
ret
;
ssize_t
n
;
ssize_t
n
;
char
path
[
MAXPATHLEN
]
=
{
0
};
n
=
readlink
(
"/proc/self/exe"
,
path
,
sizeof
(
path
));
n
=
readlink
(
"/proc/self/exe"
,
path
,
sizeof
(
path
));
if
(
n
<
0
)
{
if
(
n
<
0
||
n
>=
MAXPATHLEN
)
{
SYSERROR
(
"Failed to readlink
\"
/proc/self/exe
\"
"
);
SYSERROR
(
"Failed to readlink
\"
/proc/self/exe
\"
"
);
return
;
return
;
}
}
path
[
n
]
=
'\0'
;
path
[
n
]
=
0
;
ret
=
umount2
(
path
,
MNT_DETACH
);
if
(
ret
<
0
)
{
if
(
umount2
(
path
,
MNT_DETACH
)
<
0
)
{
SYSERROR
(
"Failed to unmount
\"
%s
\"
"
,
path
);
SYSERROR
(
"Failed to unmount
\"
%s
\"
"
,
path
);
return
;
return
;
}
}
if
(
unlink
(
path
)
<
0
)
{
ret
=
unlink
(
path
);
if
(
ret
<
0
)
{
SYSERROR
(
"Failed to unlink
\"
%s
\"
"
,
path
);
SYSERROR
(
"Failed to unlink
\"
%s
\"
"
,
path
);
return
;
return
;
}
}
...
...
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