Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
criu
Project
Project
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
zhul
criu
Commits
a7631ed8
Commit
a7631ed8
authored
Feb 18, 2015
by
Pavel Emelyanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tty: Put open() callback on tty_type
Signed-off-by:
Pavel Emelyanov
<
xemul@parallels.com
>
parent
c314ffbe
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
tty.c
tty.c
+10
-4
No files found.
tty.c
View file @
a7631ed8
...
@@ -137,6 +137,7 @@ struct tty_type {
...
@@ -137,6 +137,7 @@ struct tty_type {
int
index
;
int
index
;
int
(
*
fd_get_index
)(
int
fd
,
const
struct
fd_parms
*
);
int
(
*
fd_get_index
)(
int
fd
,
const
struct
fd_parms
*
);
int
(
*
img_get_index
)(
struct
tty_info
*
ti
);
int
(
*
img_get_index
)(
struct
tty_info
*
ti
);
int
(
*
open
)(
struct
tty_info
*
ti
);
};
};
static
int
ptm_fd_get_index
(
int
fd
,
const
struct
fd_parms
*
p
)
static
int
ptm_fd_get_index
(
int
fd
,
const
struct
fd_parms
*
p
)
...
@@ -161,23 +162,30 @@ static int pty_get_index(struct tty_info *ti)
...
@@ -161,23 +162,30 @@ static int pty_get_index(struct tty_info *ti)
return
ti
->
tie
->
pty
->
index
;
return
ti
->
tie
->
pty
->
index
;
}
}
static
int
pty_open_ptmx
(
struct
tty_info
*
info
);
static
struct
tty_type
ptm_type
=
{
static
struct
tty_type
ptm_type
=
{
.
t
=
TTY_TYPE_PTM
,
.
t
=
TTY_TYPE_PTM
,
.
name
=
"ptmx"
,
.
name
=
"ptmx"
,
.
fd_get_index
=
ptm_fd_get_index
,
.
fd_get_index
=
ptm_fd_get_index
,
.
img_get_index
=
pty_get_index
,
.
img_get_index
=
pty_get_index
,
.
open
=
pty_open_ptmx
,
};
};
static
int
open_simple_tty
(
struct
tty_info
*
info
);
static
struct
tty_type
console_type
=
{
static
struct
tty_type
console_type
=
{
.
t
=
TTY_TYPE_CONSOLE
,
.
t
=
TTY_TYPE_CONSOLE
,
.
name
=
"console"
,
.
name
=
"console"
,
.
index
=
CONSOLE_INDEX
,
.
index
=
CONSOLE_INDEX
,
.
open
=
open_simple_tty
,
};
};
static
struct
tty_type
vt_type
=
{
static
struct
tty_type
vt_type
=
{
.
t
=
TTY_TYPE_VT
,
.
t
=
TTY_TYPE_VT
,
.
name
=
"vt"
,
.
name
=
"vt"
,
.
index
=
VT_INDEX
,
.
index
=
VT_INDEX
,
.
open
=
open_simple_tty
,
};
};
static
int
pts_fd_get_index
(
int
fd
,
const
struct
fd_parms
*
p
)
static
int
pts_fd_get_index
(
int
fd
,
const
struct
fd_parms
*
p
)
...
@@ -205,6 +213,7 @@ static struct tty_type pts_type = {
...
@@ -205,6 +213,7 @@ static struct tty_type pts_type = {
.
name
=
"pts"
,
.
name
=
"pts"
,
.
fd_get_index
=
pts_fd_get_index
,
.
fd_get_index
=
pts_fd_get_index
,
.
img_get_index
=
pty_get_index
,
.
img_get_index
=
pty_get_index
,
.
open
=
pty_open_ptmx
,
};
};
struct
tty_type
*
get_tty_type
(
int
major
,
int
minor
)
struct
tty_type
*
get_tty_type
(
int
major
,
int
minor
)
...
@@ -947,10 +956,7 @@ static int tty_open(struct file_desc *d)
...
@@ -947,10 +956,7 @@ static int tty_open(struct file_desc *d)
if
(
!
tty_is_master
(
info
))
if
(
!
tty_is_master
(
info
))
return
pty_open_unpaired_slave
(
d
,
info
);
return
pty_open_unpaired_slave
(
d
,
info
);
if
(
info
->
type
->
t
==
TTY_TYPE_CONSOLE
||
info
->
type
->
t
==
TTY_TYPE_VT
)
return
info
->
type
->
open
(
info
);
return
open_simple_tty
(
info
);
return
pty_open_ptmx
(
info
);
}
}
static
int
tty_transport
(
FdinfoEntry
*
fe
,
struct
file_desc
*
d
)
static
int
tty_transport
(
FdinfoEntry
*
fe
,
struct
file_desc
*
d
)
...
...
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