diff options
| author | Richard M. Stallman | 1995-06-14 23:17:44 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1995-06-14 23:17:44 +0000 |
| commit | 394049ecabd644a825c76b40eee6c84bd14fb26c (patch) | |
| tree | e353b234bf947d3a3cfd3c9677a2a94d0ad479c3 /src | |
| parent | e8d1a377251b2c9407c78d8cc1cfd80bf17d80db (diff) | |
| download | emacs-394049ecabd644a825c76b40eee6c84bd14fb26c.tar.gz emacs-394049ecabd644a825c76b40eee6c84bd14fb26c.zip | |
(emacs_set_tty): Swap TCSETAF and TCSETAW.
Rename arg waitp to flushp.
Diffstat (limited to 'src')
| -rw-r--r-- | src/sysdep.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/sysdep.c b/src/sysdep.c index 9d352ab1beb..13417ed04e2 100644 --- a/src/sysdep.c +++ b/src/sysdep.c | |||
| @@ -1035,15 +1035,14 @@ emacs_get_tty (fd, settings) | |||
| 1035 | 1035 | ||
| 1036 | 1036 | ||
| 1037 | /* Set the parameters of the tty on FD according to the contents of | 1037 | /* Set the parameters of the tty on FD according to the contents of |
| 1038 | *SETTINGS. If WAITP is non-zero, we wait for all queued output to | 1038 | *SETTINGS. If FLUSHP is non-zero, we discard input. |
| 1039 | be written before making the change; otherwise, we forget any | ||
| 1040 | queued input and make the change immediately. | ||
| 1041 | Return 0 if all went well, and -1 if anything failed. */ | 1039 | Return 0 if all went well, and -1 if anything failed. */ |
| 1040 | |||
| 1042 | int | 1041 | int |
| 1043 | emacs_set_tty (fd, settings, waitp) | 1042 | emacs_set_tty (fd, settings, flushp) |
| 1044 | int fd; | 1043 | int fd; |
| 1045 | struct emacs_tty *settings; | 1044 | struct emacs_tty *settings; |
| 1046 | int waitp; | 1045 | int flushp; |
| 1047 | { | 1046 | { |
| 1048 | /* Set the primary parameters - baud rate, character size, etcetera. */ | 1047 | /* Set the primary parameters - baud rate, character size, etcetera. */ |
| 1049 | #ifdef HAVE_TCATTR | 1048 | #ifdef HAVE_TCATTR |
| @@ -1057,7 +1056,7 @@ emacs_set_tty (fd, settings, waitp) | |||
| 1057 | AIX requires this to keep tty from hanging occasionally." */ | 1056 | AIX requires this to keep tty from hanging occasionally." */ |
| 1058 | /* This make sure that we don't loop indefinitely in here. */ | 1057 | /* This make sure that we don't loop indefinitely in here. */ |
| 1059 | for (i = 0 ; i < 10 ; i++) | 1058 | for (i = 0 ; i < 10 ; i++) |
| 1060 | if (tcsetattr (fd, waitp ? TCSAFLUSH : TCSADRAIN, &settings->main) < 0) | 1059 | if (tcsetattr (fd, flushp ? TCSAFLUSH : TCSADRAIN, &settings->main) < 0) |
| 1061 | { | 1060 | { |
| 1062 | if (errno == EINTR) | 1061 | if (errno == EINTR) |
| 1063 | continue; | 1062 | continue; |
| @@ -1087,7 +1086,7 @@ emacs_set_tty (fd, settings, waitp) | |||
| 1087 | #else | 1086 | #else |
| 1088 | #ifdef HAVE_TERMIO | 1087 | #ifdef HAVE_TERMIO |
| 1089 | /* The SYSV-style interface? */ | 1088 | /* The SYSV-style interface? */ |
| 1090 | if (ioctl (fd, waitp ? TCSETAW : TCSETAF, &settings->main) < 0) | 1089 | if (ioctl (fd, flushp ? TCSETAF : TCSETAW, &settings->main) < 0) |
| 1091 | return -1; | 1090 | return -1; |
| 1092 | 1091 | ||
| 1093 | #else | 1092 | #else |
| @@ -1101,7 +1100,7 @@ emacs_set_tty (fd, settings, waitp) | |||
| 1101 | #else | 1100 | #else |
| 1102 | #ifndef DOS_NT | 1101 | #ifndef DOS_NT |
| 1103 | /* I give up - I hope you have the BSD ioctls. */ | 1102 | /* I give up - I hope you have the BSD ioctls. */ |
| 1104 | if (ioctl (fd, (waitp) ? TIOCSETP : TIOCSETN, &settings->main) < 0) | 1103 | if (ioctl (fd, (flushp) ? TIOCSETP : TIOCSETN, &settings->main) < 0) |
| 1105 | return -1; | 1104 | return -1; |
| 1106 | #endif /* not DOS_NT */ | 1105 | #endif /* not DOS_NT */ |
| 1107 | 1106 | ||