Commit 1334b321 authored by Jim Blandy's avatar Jim Blandy
Browse files

* sysdep.c (reset_sys_modes): Test the return value of

	EMACS_SET_TTY properly.
	* systty.h (EMACS_GET_TTY, EMACS_SET_TTY): Document the return
	values.
parent 339747e4
...@@ -1241,7 +1241,7 @@ reset_sys_modes () ...@@ -1241,7 +1241,7 @@ reset_sys_modes ()
reset_sigio (); reset_sigio ();
#endif /* BSD4_1 */ #endif /* BSD4_1 */
while (! EMACS_SET_TTY (input_fd, &old_tty, 0) && errno == EINTR) while (EMACS_SET_TTY (input_fd, &old_tty, 0) < 0 && errno == EINTR)
; ;
#ifdef AIX #ifdef AIX
......
...@@ -244,14 +244,16 @@ static struct sensemode { ...@@ -244,14 +244,16 @@ static struct sensemode {
emacs_tty should contain an element for each parameter struct emacs_tty should contain an element for each parameter struct
that Emacs may change. that Emacs may change.
EMACS_GET_TTY (int FD, struct emacs_tty *P) stores the EMACS_GET_TTY (int FD, struct emacs_tty *P) stores the parameters
parameters of the tty on FD in *P. of the tty on FD in *P. Return zero if all's well, or -1 if we ran
into an error we couldn't deal with.
EMACS_SET_TTY (int FD, struct emacs_tty *P, int waitp) EMACS_SET_TTY (int FD, struct emacs_tty *P, int waitp)
sets the parameters of the tty on FD according to the contents of sets the parameters of the tty on FD according to the contents of
*P. If waitp is non-zero, we wait for all queued output to be *P. If waitp is non-zero, we wait for all queued output to be
written before making the change; otherwise, we forget any queued written before making the change; otherwise, we forget any queued
input and make the change immediately. input and make the change immediately.
Return 0 if all went well, and -1 if anything failed.
EMACS_TTY_TABS_OK (struct emacs_tty *P) is false iff the kernel EMACS_TTY_TABS_OK (struct emacs_tty *P) is false iff the kernel
expands tabs to spaces upon output; in that case, there is no expands tabs to spaces upon output; in that case, there is no
...@@ -259,13 +261,9 @@ static struct sensemode { ...@@ -259,13 +261,9 @@ static struct sensemode {
/* For each tty parameter structure that Emacs might want to save and restore, /* For each tty parameter structure that Emacs might want to save and restore,
- include an element for it in this structure, - include an element for it in this structure, and
- define a pair of numbered macros to get and set it and return - extend the emacs_{get,set}_tty functions in sysdep.c to deal with the
true iff the call succeeded, new members. */
- give alternative definitions for when the component is not implemented
which always succeed, and
- extend the definition of EMACS_{GET,SET}_TTY_CHARS to include the
new macros. */
struct emacs_tty { struct emacs_tty {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment