Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
9c5a7d9d
Commit
9c5a7d9d
authored
Feb 25, 2005
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix possible pty line discipline race.
This ain't pretty. Real fix under discussion.
parent
06c8faf3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
drivers/char/pty.c
drivers/char/pty.c
+4
-2
No files found.
drivers/char/pty.c
View file @
9c5a7d9d
...
@@ -149,13 +149,15 @@ static int pty_write_room(struct tty_struct *tty)
...
@@ -149,13 +149,15 @@ static int pty_write_room(struct tty_struct *tty)
static
int
pty_chars_in_buffer
(
struct
tty_struct
*
tty
)
static
int
pty_chars_in_buffer
(
struct
tty_struct
*
tty
)
{
{
struct
tty_struct
*
to
=
tty
->
link
;
struct
tty_struct
*
to
=
tty
->
link
;
ssize_t
(
*
chars_in_buffer
)(
struct
tty_struct
*
);
int
count
;
int
count
;
if
(
!
to
||
!
to
->
ldisc
.
chars_in_buffer
)
/* We should get the line discipline lock for "tty->link" */
if
(
!
to
||
!
(
chars_in_buffer
=
to
->
ldisc
.
chars_in_buffer
))
return
0
;
return
0
;
/* The ldisc must report 0 if no characters available to be read */
/* The ldisc must report 0 if no characters available to be read */
count
=
to
->
ldisc
.
chars_in_buffer
(
to
);
count
=
chars_in_buffer
(
to
);
if
(
tty
->
driver
->
subtype
==
PTY_TYPE_SLAVE
)
return
count
;
if
(
tty
->
driver
->
subtype
==
PTY_TYPE_SLAVE
)
return
count
;
...
...
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