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
84aa3ace
Commit
84aa3ace
authored
Mar 15, 1993
by
Richard M. Stallman
Browse files
(wait_reading_process_input): New option to wait
till a given cons cell has a non-nil car. Delete vipc conditionals.
parent
ed5af96f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
39 deletions
+14
-39
src/process.c
src/process.c
+14
-39
No files found.
src/process.c
View file @
84aa3ace
...
...
@@ -211,13 +211,6 @@ char *sys_siglist[] =
#endif
#endif
/* VMS */
#ifdef vipc
#include "vipc.h"
extern
int
comm_server
;
extern
int
net_listen_address
;
#endif
/* vipc */
/* t means use pty, nil means use a pipe,
maybe other values to come. */
Lisp_Object
Vprocess_connection_type
;
...
...
@@ -1658,8 +1651,9 @@ static int waiting_for_user_input_p;
read_kbd is a lisp value:
0 to ignore keyboard input, or
1 to return when input is available, or
-1 mean
s
caller will actually read the input, so don't throw to
-1 mean
ing
caller will actually read the input, so don't throw to
the quit handler, or
a cons cell, meaning wait wait until its car is non-nil, or
a process object, meaning wait until something arrives from that
process. The return value is true iff we read some input from
that process.
...
...
@@ -1686,6 +1680,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display)
int
wait_channel
=
0
;
struct
Lisp_Process
*
wait_proc
=
0
;
int
got_some_input
=
0
;
Lisp_Object
*
wait_for_cell
=
0
;
FD_ZERO
(
&
Available
);
...
...
@@ -1698,6 +1693,13 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display)
XFASTINT
(
read_kbd
)
=
0
;
}
/* If waiting for non-nil in a cell, record where. */
if
(
XTYPE
(
read_kbd
)
==
Lisp_Cons
)
{
wait_for_cell
=
&
XCONS
(
read_kbd
)
->
car
;
XFASTINT
(
read_kbd
)
=
0
;
}
waiting_for_user_input_p
=
XINT
(
read_kbd
);
/* Since we may need to wait several times,
...
...
@@ -1846,29 +1848,20 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display)
if
(
XINT
(
read_kbd
)
&&
detect_input_pending
())
break
;
/* Exit now if the cell we're waiting for became non-nil. */
if
(
wait_for_cell
&&
!
NILP
(
*
wait_for_cell
))
break
;
#ifdef SIGIO
/* If we think we have keyboard input waiting, but didn't get SIGIO
go read it. This can happen with X on BSD after logging out.
In that case, there really is no input and no SIGIO,
but select says there is input. */
/*
if (XINT (read_kbd) && interrupt_input && (Available & fileno (stdin)))
*/
if
(
XINT
(
read_kbd
)
&&
interrupt_input
&&
(
FD_ISSET
(
fileno
(
stdin
),
&
Available
)))
kill
(
0
,
SIGIO
);
#endif
#ifdef vipc
/* Check for connection from other process */
if
(
Available
&
ChannelMask
(
comm_server
))
{
Available
&=
~
(
ChannelMask
(
comm_server
));
create_commchan
();
}
#endif
/* vipc */
if
(
!
wait_proc
)
got_some_input
|=
nfds
>
0
;
...
...
@@ -1897,24 +1890,6 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display)
if
(
NILP
(
proc
))
continue
;
#ifdef vipc
/* It's a command channel */
if
(
!
NILP
(
XPROCESS
(
proc
)
->
command_channel_p
))
{
ProcessCommChan
(
channel
,
proc
);
if
(
NILP
(
XPROCESS
(
proc
)
->
command_channel_p
))
{
/* It has ceased to be a command channel! */
int
bytes_available
;
if
(
ioctl
(
channel
,
FIONREAD
,
&
bytes_available
)
<
0
)
bytes_available
=
0
;
if
(
bytes_available
)
FD_SET
(
channel
,
&
Available
);
}
continue
;
}
#endif
/* vipc */
/* Read data from the process, starting with our
buffered-ahead character if we have one. */
...
...
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