Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
38f6438b
Commit
38f6438b
authored
Nov 18, 1993
by
Richard M. Stallman
Browse files
(read_avail_input): Don't set nread to -1
if we loop around in the loop that calls read.
parent
0e93a7cf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
src/keyboard.c
src/keyboard.c
+7
-4
No files found.
src/keyboard.c
View file @
38f6438b
...
...
@@ -3059,23 +3059,26 @@ read_avail_input (expected)
/* Now read; for one reason or another, this will not block. */
while
(
1
)
{
nread
=
read
(
fileno
(
stdin
),
cbuf
,
nread
);
int
value
=
read
(
fileno
(
stdin
),
cbuf
,
nread
);
#ifdef AIX
/* The kernel sometimes fails to deliver SIGHUP for ptys.
This looks incorrect, but it isn't, because _BSD causes
O_NDELAY to be defined in fcntl.h as O_NONBLOCK,
and that causes a value other than 0 when there is no input. */
if
(
nread
==
0
)
if
(
value
==
0
)
kill
(
SIGHUP
,
0
);
#endif
/* Retry the read if it is interrupted. */
if
(
nread
>=
0
if
(
value
>=
0
||
!
(
errno
==
EAGAIN
||
errno
==
EFAULT
#ifdef EBADSLT
||
errno
==
EBADSLT
#endif
))
break
;
{
nread
=
value
;
break
;
}
}
#ifndef FIONREAD
...
...
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