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
d3ccc04e
Unverified
Commit
d3ccc04e
authored
Jun 14, 2018
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
coverity: #1425758
Time of check time of use Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
b29e05d6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
12 deletions
+4
-12
conf.c
src/lxc/conf.c
+4
-12
No files found.
src/lxc/conf.c
View file @
d3ccc04e
...
@@ -924,16 +924,9 @@ static int lxc_setup_ttys(struct lxc_conf *conf)
...
@@ -924,16 +924,9 @@ static int lxc_setup_ttys(struct lxc_conf *conf)
/* If we populated /dev, then we need to create
/* If we populated /dev, then we need to create
* /dev/ttyN
* /dev/ttyN
*/
*/
ret
=
access
(
path
,
F_OK
);
ret
=
mknod
(
path
,
S_IFREG
|
0000
,
0
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
/* this isn't fatal, continue */
ret
=
creat
(
path
,
0660
);
ERROR
(
"%s - Failed to create
\"
%s
\"
"
,
strerror
(
errno
),
path
);
if
(
ret
<
0
)
{
SYSERROR
(
"Failed to create
\"
%s
\"
"
,
path
);
/* this isn't fatal, continue */
}
else
{
close
(
ret
);
}
}
ret
=
mount
(
tty
->
name
,
path
,
"none"
,
MS_BIND
,
0
);
ret
=
mount
(
tty
->
name
,
path
,
"none"
,
MS_BIND
,
0
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
...
@@ -941,8 +934,7 @@ static int lxc_setup_ttys(struct lxc_conf *conf)
...
@@ -941,8 +934,7 @@ static int lxc_setup_ttys(struct lxc_conf *conf)
continue
;
continue
;
}
}
DEBUG
(
"Bind mounted
\"
%s
\"
onto
\"
%s
\"
"
,
tty
->
name
,
DEBUG
(
"Bind mounted
\"
%s
\"
onto
\"
%s
\"
"
,
tty
->
name
,
path
);
path
);
}
}
if
(
!
append_ttyname
(
&
conf
->
ttys
.
tty_names
,
tty
->
name
))
{
if
(
!
append_ttyname
(
&
conf
->
ttys
.
tty_names
,
tty
->
name
))
{
...
...
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