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
6711ffc1
Commit
6711ffc1
authored
Sep 20, 2013
by
Serge Hallyn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix console deadlocks
Signed-off-by:
Serge Hallyn
<
serge.hallyn@ubuntu.com
>
Acked-by:
Stéphane Graber
<
stgraber@ubuntu.com
>
parent
e3f46bfb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
11 deletions
+0
-11
console.c
src/lxc/console.c
+0
-11
No files found.
src/lxc/console.c
View file @
6711ffc1
...
@@ -103,13 +103,10 @@ void lxc_console_sigwinch(int sig)
...
@@ -103,13 +103,10 @@ void lxc_console_sigwinch(int sig)
struct
lxc_list
*
it
;
struct
lxc_list
*
it
;
struct
lxc_tty_state
*
ts
;
struct
lxc_tty_state
*
ts
;
process_lock
();
lxc_list_for_each
(
it
,
&
lxc_ttys
)
{
lxc_list_for_each
(
it
,
&
lxc_ttys
)
{
ts
=
it
->
elem
;
ts
=
it
->
elem
;
lxc_console_winch
(
ts
);
lxc_console_winch
(
ts
);
}
}
process_unlock
();
}
}
static
int
lxc_console_cb_sigwinch_fd
(
int
fd
,
void
*
cbdata
,
static
int
lxc_console_cb_sigwinch_fd
(
int
fd
,
void
*
cbdata
,
...
@@ -423,7 +420,6 @@ int lxc_console_allocate(struct lxc_conf *conf, int sockfd, int *ttyreq)
...
@@ -423,7 +420,6 @@ int lxc_console_allocate(struct lxc_conf *conf, int sockfd, int *ttyreq)
struct
lxc_tty_info
*
tty_info
=
&
conf
->
tty_info
;
struct
lxc_tty_info
*
tty_info
=
&
conf
->
tty_info
;
struct
lxc_console
*
console
=
&
conf
->
console
;
struct
lxc_console
*
console
=
&
conf
->
console
;
process_lock
();
if
(
*
ttyreq
==
0
)
{
if
(
*
ttyreq
==
0
)
{
if
(
lxc_console_peer_proxy_alloc
(
console
,
sockfd
)
<
0
)
if
(
lxc_console_peer_proxy_alloc
(
console
,
sockfd
)
<
0
)
goto
out
;
goto
out
;
...
@@ -458,7 +454,6 @@ out_tty:
...
@@ -458,7 +454,6 @@ out_tty:
tty_info
->
pty_info
[
ttynum
-
1
].
busy
=
sockfd
;
tty_info
->
pty_info
[
ttynum
-
1
].
busy
=
sockfd
;
masterfd
=
tty_info
->
pty_info
[
ttynum
-
1
].
master
;
masterfd
=
tty_info
->
pty_info
[
ttynum
-
1
].
master
;
out
:
out
:
process_unlock
();
return
masterfd
;
return
masterfd
;
}
}
...
@@ -476,7 +471,6 @@ void lxc_console_free(struct lxc_conf *conf, int fd)
...
@@ -476,7 +471,6 @@ void lxc_console_free(struct lxc_conf *conf, int fd)
struct
lxc_tty_info
*
tty_info
=
&
conf
->
tty_info
;
struct
lxc_tty_info
*
tty_info
=
&
conf
->
tty_info
;
struct
lxc_console
*
console
=
&
conf
->
console
;
struct
lxc_console
*
console
=
&
conf
->
console
;
process_lock
();
for
(
i
=
0
;
i
<
tty_info
->
nbtty
;
i
++
)
{
for
(
i
=
0
;
i
<
tty_info
->
nbtty
;
i
++
)
{
if
(
tty_info
->
pty_info
[
i
].
busy
==
fd
)
if
(
tty_info
->
pty_info
[
i
].
busy
==
fd
)
tty_info
->
pty_info
[
i
].
busy
=
0
;
tty_info
->
pty_info
[
i
].
busy
=
0
;
...
@@ -486,7 +480,6 @@ void lxc_console_free(struct lxc_conf *conf, int fd)
...
@@ -486,7 +480,6 @@ void lxc_console_free(struct lxc_conf *conf, int fd)
lxc_mainloop_del_handler
(
console
->
descr
,
console
->
peerpty
.
slave
);
lxc_mainloop_del_handler
(
console
->
descr
,
console
->
peerpty
.
slave
);
lxc_console_peer_proxy_free
(
console
);
lxc_console_peer_proxy_free
(
console
);
}
}
process_unlock
();
}
}
static
void
lxc_console_peer_default
(
struct
lxc_console
*
console
)
static
void
lxc_console_peer_default
(
struct
lxc_console
*
console
)
...
@@ -713,9 +706,7 @@ int lxc_console(struct lxc_container *c, int ttynum,
...
@@ -713,9 +706,7 @@ int lxc_console(struct lxc_container *c, int ttynum,
return
-
1
;
return
-
1
;
}
}
process_lock
();
ttyfd
=
lxc_cmd_console
(
c
->
name
,
&
ttynum
,
&
masterfd
,
c
->
config_path
);
ttyfd
=
lxc_cmd_console
(
c
->
name
,
&
ttynum
,
&
masterfd
,
c
->
config_path
);
process_unlock
();
if
(
ttyfd
<
0
)
{
if
(
ttyfd
<
0
)
{
ret
=
ttyfd
;
ret
=
ttyfd
;
goto
err1
;
goto
err1
;
...
@@ -770,9 +761,7 @@ int lxc_console(struct lxc_container *c, int ttynum,
...
@@ -770,9 +761,7 @@ int lxc_console(struct lxc_container *c, int ttynum,
goto
err4
;
goto
err4
;
}
}
process_lock
();
ret
=
lxc_mainloop
(
&
descr
,
-
1
);
ret
=
lxc_mainloop
(
&
descr
,
-
1
);
process_unlock
();
if
(
ret
)
{
if
(
ret
)
{
ERROR
(
"mainloop returned an error"
);
ERROR
(
"mainloop returned an error"
);
goto
err4
;
goto
err4
;
...
...
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