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
a7764ce7
Unverified
Commit
a7764ce7
authored
Feb 23, 2018
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lxccontainer: do_add_remove_node()
thread-safety: s/exit()/_exit()/g Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
d8480a31
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
lxccontainer.c
src/lxc/lxccontainer.c
+8
-8
No files found.
src/lxc/lxccontainer.c
View file @
a7764ce7
...
@@ -4262,11 +4262,11 @@ static bool do_add_remove_node(pid_t init_pid, const char *path, bool add,
...
@@ -4262,11 +4262,11 @@ static bool do_add_remove_node(pid_t init_pid, const char *path, bool add,
ret
=
chroot
(
chrootpath
);
ret
=
chroot
(
chrootpath
);
if
(
ret
<
0
)
if
(
ret
<
0
)
exit
(
EXIT_FAILURE
);
_
exit
(
EXIT_FAILURE
);
ret
=
chdir
(
"/"
);
ret
=
chdir
(
"/"
);
if
(
ret
<
0
)
if
(
ret
<
0
)
exit
(
EXIT_FAILURE
);
_
exit
(
EXIT_FAILURE
);
/* remove path if it exists */
/* remove path if it exists */
ret
=
faccessat
(
AT_FDCWD
,
path
,
F_OK
,
AT_SYMLINK_NOFOLLOW
);
ret
=
faccessat
(
AT_FDCWD
,
path
,
F_OK
,
AT_SYMLINK_NOFOLLOW
);
...
@@ -4274,24 +4274,24 @@ static bool do_add_remove_node(pid_t init_pid, const char *path, bool add,
...
@@ -4274,24 +4274,24 @@ static bool do_add_remove_node(pid_t init_pid, const char *path, bool add,
ret
=
unlink
(
path
);
ret
=
unlink
(
path
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
ERROR
(
"%s - Failed to remove
\"
%s
\"
"
,
strerror
(
errno
),
path
);
ERROR
(
"%s - Failed to remove
\"
%s
\"
"
,
strerror
(
errno
),
path
);
exit
(
EXIT_FAILURE
);
_
exit
(
EXIT_FAILURE
);
}
}
}
}
if
(
!
add
)
if
(
!
add
)
exit
(
EXIT_SUCCESS
);
_
exit
(
EXIT_SUCCESS
);
/* create any missing directories */
/* create any missing directories */
tmp
=
strdup
(
path
);
tmp
=
strdup
(
path
);
if
(
!
tmp
)
if
(
!
tmp
)
exit
(
EXIT_FAILURE
);
_
exit
(
EXIT_FAILURE
);
directory_path
=
dirname
(
tmp
);
directory_path
=
dirname
(
tmp
);
ret
=
mkdir_p
(
directory_path
,
0755
);
ret
=
mkdir_p
(
directory_path
,
0755
);
if
(
ret
<
0
&&
errno
!=
EEXIST
)
{
if
(
ret
<
0
&&
errno
!=
EEXIST
)
{
ERROR
(
"%s - Failed to create path
\"
%s
\"
"
,
strerror
(
errno
),
directory_path
);
ERROR
(
"%s - Failed to create path
\"
%s
\"
"
,
strerror
(
errno
),
directory_path
);
free
(
tmp
);
free
(
tmp
);
exit
(
EXIT_FAILURE
);
_
exit
(
EXIT_FAILURE
);
}
}
/* create the device node */
/* create the device node */
...
@@ -4299,10 +4299,10 @@ static bool do_add_remove_node(pid_t init_pid, const char *path, bool add,
...
@@ -4299,10 +4299,10 @@ static bool do_add_remove_node(pid_t init_pid, const char *path, bool add,
free
(
tmp
);
free
(
tmp
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
ERROR
(
"%s - Failed to create device node at
\"
%s
\"
"
,
strerror
(
errno
),
path
);
ERROR
(
"%s - Failed to create device node at
\"
%s
\"
"
,
strerror
(
errno
),
path
);
exit
(
EXIT_FAILURE
);
_
exit
(
EXIT_FAILURE
);
}
}
exit
(
EXIT_SUCCESS
);
_
exit
(
EXIT_SUCCESS
);
}
}
static
bool
add_remove_device_node
(
struct
lxc_container
*
c
,
const
char
*
src_path
,
const
char
*
dest_path
,
bool
add
)
static
bool
add_remove_device_node
(
struct
lxc_container
*
c
,
const
char
*
src_path
,
const
char
*
dest_path
,
bool
add
)
...
...
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