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
92ef1f8a
Unverified
Commit
92ef1f8a
authored
Dec 06, 2019
by
Christian Brauner
Committed by
GitHub
Dec 06, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3214 from Rachid-Koucha/patch-1
"busy" field init to -1 instead of 0
parents
6b3dccea
730aaf46
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
conf.c
src/lxc/conf.c
+1
-1
start.c
src/lxc/start.c
+2
-2
terminal.c
src/lxc/terminal.c
+3
-3
No files found.
src/lxc/conf.c
View file @
92ef1f8a
...
...
@@ -1006,7 +1006,7 @@ int lxc_allocate_ttys(struct lxc_conf *conf)
SYSWARN
(
"Failed to set FD_CLOEXEC flag on slave fd %d of "
"tty device
\"
%s
\"
"
,
tty
->
slave
,
tty
->
name
);
tty
->
busy
=
0
;
tty
->
busy
=
-
1
;
}
INFO
(
"Finished creating %zu tty devices"
,
ttys
->
max
);
...
...
src/lxc/start.c
View file @
92ef1f8a
...
...
@@ -1526,11 +1526,11 @@ static int lxc_recv_ttys_from_child(struct lxc_handler *handler)
break
;
tty
=
&
ttys
->
tty
[
i
];
tty
->
busy
=
0
;
tty
->
busy
=
-
1
;
tty
->
master
=
ttyfds
[
0
];
tty
->
slave
=
ttyfds
[
1
];
TRACE
(
"Received pty with master fd %d and slave fd %d from "
"
parent
"
,
tty
->
master
,
tty
->
slave
);
"
child
"
,
tty
->
master
,
tty
->
slave
);
}
if
(
ret
<
0
)
...
...
src/lxc/terminal.c
View file @
92ef1f8a
...
...
@@ -593,7 +593,7 @@ int lxc_terminal_allocate(struct lxc_conf *conf, int sockfd, int *ttyreq)
if
(
*
ttyreq
>
ttys
->
max
)
goto
out
;
if
(
ttys
->
tty
[
*
ttyreq
-
1
].
busy
)
if
(
ttys
->
tty
[
*
ttyreq
-
1
].
busy
>=
0
)
goto
out
;
/* The requested tty is available. */
...
...
@@ -602,7 +602,7 @@ int lxc_terminal_allocate(struct lxc_conf *conf, int sockfd, int *ttyreq)
}
/* Search for next available tty, fixup index tty1 => [0]. */
for
(
ttynum
=
1
;
ttynum
<=
ttys
->
max
&&
ttys
->
tty
[
ttynum
-
1
].
busy
;
ttynum
++
)
{
for
(
ttynum
=
1
;
ttynum
<=
ttys
->
max
&&
ttys
->
tty
[
ttynum
-
1
].
busy
>=
0
;
ttynum
++
)
{
;
}
...
...
@@ -628,7 +628,7 @@ void lxc_terminal_free(struct lxc_conf *conf, int fd)
for
(
i
=
0
;
i
<
ttys
->
max
;
i
++
)
if
(
ttys
->
tty
[
i
].
busy
==
fd
)
ttys
->
tty
[
i
].
busy
=
0
;
ttys
->
tty
[
i
].
busy
=
-
1
;
if
(
terminal
->
proxy
.
busy
!=
fd
)
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