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
c639f45e
Unverified
Commit
c639f45e
authored
Oct 20, 2020
by
Stéphane Graber
Committed by
GitHub
Oct 20, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3559 from brauner/2020-10-20/fixes
conf: account for early return when sending devpts fd
parents
f4da1c37
185b9ee9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
conf.c
src/lxc/conf.c
+8
-9
No files found.
src/lxc/conf.c
View file @
c639f45e
...
...
@@ -1549,7 +1549,14 @@ static int lxc_setup_devpts_child(struct lxc_handler *handler)
if
(
devpts_fd
<
0
)
{
devpts_fd
=
-
EBADF
;
TRACE
(
"Failed to create detached devpts mount"
);
ret
=
lxc_abstract_unix_send_fds
(
sock
,
NULL
,
0
,
&
devpts_fd
,
sizeof
(
int
));
}
else
{
ret
=
lxc_abstract_unix_send_fds
(
sock
,
&
devpts_fd
,
1
,
NULL
,
0
);
}
if
(
ret
<
0
)
return
log_error_errno
(
-
1
,
errno
,
"Failed to send devpts fd to parent"
);
TRACE
(
"Sent devpts file descriptor %d to parent"
,
devpts_fd
);
/* Remove any pre-existing /dev/ptmx file. */
ret
=
remove
(
"/dev/ptmx"
);
...
...
@@ -1583,16 +1590,8 @@ static int lxc_setup_devpts_child(struct lxc_handler *handler)
ret
=
symlink
(
"/dev/pts/ptmx"
,
"/dev/ptmx"
);
if
(
ret
<
0
)
return
log_error_errno
(
-
1
,
errno
,
"Failed to create symlink from
\"
/dev/ptmx
\"
to
\"
/dev/pts/ptmx
\"
"
);
DEBUG
(
"Created symlink from
\"
/dev/ptmx
\"
to
\"
/dev/pts/ptmx
\"
"
);
if
(
devpts_fd
<
0
)
ret
=
lxc_abstract_unix_send_fds
(
sock
,
NULL
,
0
,
&
devpts_fd
,
sizeof
(
int
));
else
ret
=
lxc_abstract_unix_send_fds
(
sock
,
&
devpts_fd
,
1
,
NULL
,
0
);
if
(
ret
<
0
)
return
log_error_errno
(
-
1
,
errno
,
"Failed to send devpts fd to parent"
);
TRACE
(
"Sent devpts file descriptor %d to parent"
,
devpts_fd
);
DEBUG
(
"Created symlink from
\"
/dev/ptmx
\"
to
\"
/dev/pts/ptmx
\"
"
);
return
0
;
}
...
...
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