changeset 2873:f1cd54cf1b67

* 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.
author Jim Blandy <jimb@redhat.com>
date Tue, 18 May 1993 22:45:29 +0000
parents 0ab5a9f88ff3
children 80805283464a
files src/sysdep.c src/systty.h
diffstat 2 files changed, 8 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/sysdep.c	Tue May 18 22:44:27 1993 +0000
+++ b/src/sysdep.c	Tue May 18 22:45:29 1993 +0000
@@ -1241,7 +1241,7 @@
     reset_sigio ();
 #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
--- a/src/systty.h	Tue May 18 22:44:27 1993 +0000
+++ b/src/systty.h	Tue May 18 22:45:29 1993 +0000
@@ -244,14 +244,16 @@
    emacs_tty should contain an element for each parameter struct
    that Emacs may change.
 
-   EMACS_GET_TTY (int FD, struct emacs_tty *P) stores the
-   parameters of the tty on FD in *P.
+   EMACS_GET_TTY (int FD, struct emacs_tty *P) stores the parameters
+   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)
    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
    written before making the change; otherwise, we forget any queued
    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
    expands tabs to spaces upon output; in that case, there is no
@@ -259,13 +261,9 @@
 
 
 /* For each tty parameter structure that Emacs might want to save and restore,
-   - include an element for it in this structure,
-   - define a pair of numbered macros to get and set it and return 
-     true iff the call succeeded,
-   - 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.  */
+   - include an element for it in this structure, and
+   - extend the emacs_{get,set}_tty functions in sysdep.c to deal with the
+     new members.  */
 
 struct emacs_tty {