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
6387d4ea
Commit
6387d4ea
authored
Aug 07, 2004
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mark tty's as being non-seekable, and remove the now
unnecessary tests at read/write time.
parent
22782ffc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
17 deletions
+1
-17
drivers/char/tty_io.c
drivers/char/tty_io.c
+1
-17
No files found.
drivers/char/tty_io.c
View file @
6387d4ea
...
...
@@ -345,18 +345,12 @@ EXPORT_SYMBOL(tty_check_change);
static
ssize_t
hung_up_tty_read
(
struct
file
*
file
,
char
__user
*
buf
,
size_t
count
,
loff_t
*
ppos
)
{
/* Can't seek (pread) on ttys. */
if
(
ppos
!=
&
file
->
f_pos
)
return
-
ESPIPE
;
return
0
;
}
static
ssize_t
hung_up_tty_write
(
struct
file
*
file
,
const
char
__user
*
buf
,
size_t
count
,
loff_t
*
ppos
)
{
/* Can't seek (pwrite) on ttys. */
if
(
ppos
!=
&
file
->
f_pos
)
return
-
ESPIPE
;
return
-
EIO
;
}
...
...
@@ -648,10 +642,6 @@ static ssize_t tty_read(struct file * file, char __user * buf, size_t count,
struct
tty_struct
*
tty
;
struct
inode
*
inode
;
/* Can't seek (pread) on ttys. */
if
(
ppos
!=
&
file
->
f_pos
)
return
-
ESPIPE
;
tty
=
(
struct
tty_struct
*
)
file
->
private_data
;
inode
=
file
->
f_dentry
->
d_inode
;
if
(
tty_paranoia_check
(
tty
,
inode
,
"tty_read"
))
...
...
@@ -726,10 +716,6 @@ static ssize_t tty_write(struct file * file, const char __user * buf, size_t cou
struct
tty_struct
*
tty
;
struct
inode
*
inode
=
file
->
f_dentry
->
d_inode
;
/* Can't seek (pwrite) on ttys. */
if
(
ppos
!=
&
file
->
f_pos
)
return
-
ESPIPE
;
tty
=
(
struct
tty_struct
*
)
file
->
private_data
;
if
(
tty_paranoia_check
(
tty
,
inode
,
"tty_write"
))
return
-
EIO
;
...
...
@@ -755,9 +741,6 @@ ssize_t redirected_tty_write(struct file * file, const char __user * buf, size_t
if
(
p
)
{
ssize_t
res
;
/* Can't seek (pwrite) on ttys. */
if
(
ppos
!=
&
file
->
f_pos
)
return
-
ESPIPE
;
res
=
vfs_write
(
p
,
buf
,
count
,
&
p
->
f_pos
);
fput
(
p
);
return
res
;
...
...
@@ -1339,6 +1322,7 @@ static int tty_open(struct inode * inode, struct file * filp)
dev_t
device
=
inode
->
i_rdev
;
unsigned
short
saved_flags
=
filp
->
f_flags
;
nonseekable_open
(
inode
,
filp
);
retry_open:
noctty
=
filp
->
f_flags
&
O_NOCTTY
;
index
=
-
1
;
...
...
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