aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJim Blandy1993-05-18 22:45:29 +0000
committerJim Blandy1993-05-18 22:45:29 +0000
commit1334b321d60d0ce12936fb5f50ad621e9308e0f0 (patch)
treea420585e684f001424b8e6c4be37deb881dfeedb /src
parent339747e43865f9e5b610cc1e667d3c44fbd24b1a (diff)
downloademacs-1334b321d60d0ce12936fb5f50ad621e9308e0f0.tar.gz
emacs-1334b321d60d0ce12936fb5f50ad621e9308e0f0.zip
* 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.
Diffstat (limited to 'src')
-rw-r--r--src/sysdep.c2
-rw-r--r--src/systty.h16
2 files changed, 8 insertions, 10 deletions
diff --git a/src/sysdep.c b/src/sysdep.c
index c139eed5d8f..a6c1bdfbb34 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -1241,7 +1241,7 @@ reset_sys_modes ()
1241 reset_sigio (); 1241 reset_sigio ();
1242#endif /* BSD4_1 */ 1242#endif /* BSD4_1 */
1243 1243
1244 while (! EMACS_SET_TTY (input_fd, &old_tty, 0) && errno == EINTR) 1244 while (EMACS_SET_TTY (input_fd, &old_tty, 0) < 0 && errno == EINTR)
1245 ; 1245 ;
1246 1246
1247#ifdef AIX 1247#ifdef AIX
diff --git a/src/systty.h b/src/systty.h
index 7e416f05e2b..0123fbbae2e 100644
--- a/src/systty.h
+++ b/src/systty.h
@@ -244,14 +244,16 @@ static struct sensemode {
244 emacs_tty should contain an element for each parameter struct 244 emacs_tty should contain an element for each parameter struct
245 that Emacs may change. 245 that Emacs may change.
246 246
247 EMACS_GET_TTY (int FD, struct emacs_tty *P) stores the 247 EMACS_GET_TTY (int FD, struct emacs_tty *P) stores the parameters
248 parameters of the tty on FD in *P. 248 of the tty on FD in *P. Return zero if all's well, or -1 if we ran
249 into an error we couldn't deal with.
249 250
250 EMACS_SET_TTY (int FD, struct emacs_tty *P, int waitp) 251 EMACS_SET_TTY (int FD, struct emacs_tty *P, int waitp)
251 sets the parameters of the tty on FD according to the contents of 252 sets the parameters of the tty on FD according to the contents of
252 *P. If waitp is non-zero, we wait for all queued output to be 253 *P. If waitp is non-zero, we wait for all queued output to be
253 written before making the change; otherwise, we forget any queued 254 written before making the change; otherwise, we forget any queued
254 input and make the change immediately. 255 input and make the change immediately.
256 Return 0 if all went well, and -1 if anything failed.
255 257
256 EMACS_TTY_TABS_OK (struct emacs_tty *P) is false iff the kernel 258 EMACS_TTY_TABS_OK (struct emacs_tty *P) is false iff the kernel
257 expands tabs to spaces upon output; in that case, there is no 259 expands tabs to spaces upon output; in that case, there is no
@@ -259,13 +261,9 @@ static struct sensemode {
259 261
260 262
261/* For each tty parameter structure that Emacs might want to save and restore, 263/* For each tty parameter structure that Emacs might want to save and restore,
262 - include an element for it in this structure, 264 - include an element for it in this structure, and
263 - define a pair of numbered macros to get and set it and return 265 - extend the emacs_{get,set}_tty functions in sysdep.c to deal with the
264 true iff the call succeeded, 266 new members. */
265 - give alternative definitions for when the component is not implemented
266 which always succeed, and
267 - extend the definition of EMACS_{GET,SET}_TTY_CHARS to include the
268 new macros. */
269 267
270struct emacs_tty { 268struct emacs_tty {
271 269