diff options
| author | Paul Eggert | 2011-05-02 22:47:50 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-05-02 22:47:50 -0700 |
| commit | aceeea6c4510002d8fe99b2e6727532ba9cdd8ea (patch) | |
| tree | 2be9fe4b48ca3ba75c93160c03c22889d80b1cad /src/sysdep.c | |
| parent | 79f5556a7a75ed21c4fafa04f02adb81822a57f9 (diff) | |
| parent | 256661260dfed952d6497aef73607bfe24795614 (diff) | |
| download | emacs-aceeea6c4510002d8fe99b2e6727532ba9cdd8ea.tar.gz emacs-aceeea6c4510002d8fe99b2e6727532ba9cdd8ea.zip | |
Merge from mainline.
Diffstat (limited to 'src/sysdep.c')
| -rw-r--r-- | src/sysdep.c | 50 |
1 files changed, 38 insertions, 12 deletions
diff --git a/src/sysdep.c b/src/sysdep.c index 43f50cdb0a9..5ad3389dd8f 100644 --- a/src/sysdep.c +++ b/src/sysdep.c | |||
| @@ -296,11 +296,9 @@ init_baud_rate (int fd) | |||
| 296 | int wait_debugging EXTERNALLY_VISIBLE; | 296 | int wait_debugging EXTERNALLY_VISIBLE; |
| 297 | 297 | ||
| 298 | #ifndef MSDOS | 298 | #ifndef MSDOS |
| 299 | /* Wait for subprocess with process id `pid' to terminate and | ||
| 300 | make sure it will get eliminated (not remain forever as a zombie) */ | ||
| 301 | 299 | ||
| 302 | void | 300 | static void |
| 303 | wait_for_termination (int pid) | 301 | wait_for_termination_1 (int pid, int interruptible) |
| 304 | { | 302 | { |
| 305 | while (1) | 303 | while (1) |
| 306 | { | 304 | { |
| @@ -339,9 +337,27 @@ wait_for_termination (int pid) | |||
| 339 | sigsuspend (&empty_mask); | 337 | sigsuspend (&empty_mask); |
| 340 | #endif /* not WINDOWSNT */ | 338 | #endif /* not WINDOWSNT */ |
| 341 | #endif /* not BSD_SYSTEM, and not HPUX version >= 6 */ | 339 | #endif /* not BSD_SYSTEM, and not HPUX version >= 6 */ |
| 340 | if (interruptible) | ||
| 341 | QUIT; | ||
| 342 | } | 342 | } |
| 343 | } | 343 | } |
| 344 | 344 | ||
| 345 | /* Wait for subprocess with process id `pid' to terminate and | ||
| 346 | make sure it will get eliminated (not remain forever as a zombie) */ | ||
| 347 | |||
| 348 | void | ||
| 349 | wait_for_termination (int pid) | ||
| 350 | { | ||
| 351 | wait_for_termination_1 (pid, 0); | ||
| 352 | } | ||
| 353 | |||
| 354 | /* Like the above, but allow keyboard interruption. */ | ||
| 355 | void | ||
| 356 | interruptible_wait_for_termination (int pid) | ||
| 357 | { | ||
| 358 | wait_for_termination_1 (pid, 1); | ||
| 359 | } | ||
| 360 | |||
| 345 | /* | 361 | /* |
| 346 | * flush any pending output | 362 | * flush any pending output |
| 347 | * (may flush input as well; it does not matter the way we use it) | 363 | * (may flush input as well; it does not matter the way we use it) |
| @@ -1109,8 +1125,7 @@ tabs_safe_p (int fd) | |||
| 1109 | void | 1125 | void |
| 1110 | get_tty_size (int fd, int *widthp, int *heightp) | 1126 | get_tty_size (int fd, int *widthp, int *heightp) |
| 1111 | { | 1127 | { |
| 1112 | 1128 | #if defined TIOCGWINSZ | |
| 1113 | #ifdef TIOCGWINSZ | ||
| 1114 | 1129 | ||
| 1115 | /* BSD-style. */ | 1130 | /* BSD-style. */ |
| 1116 | struct winsize size; | 1131 | struct winsize size; |
| @@ -1123,8 +1138,7 @@ get_tty_size (int fd, int *widthp, int *heightp) | |||
| 1123 | *heightp = size.ws_row; | 1138 | *heightp = size.ws_row; |
| 1124 | } | 1139 | } |
| 1125 | 1140 | ||
| 1126 | #else | 1141 | #elif defined TIOCGSIZE |
| 1127 | #ifdef TIOCGSIZE | ||
| 1128 | 1142 | ||
| 1129 | /* SunOS - style. */ | 1143 | /* SunOS - style. */ |
| 1130 | struct ttysize size; | 1144 | struct ttysize size; |
| @@ -1137,16 +1151,28 @@ get_tty_size (int fd, int *widthp, int *heightp) | |||
| 1137 | *heightp = size.ts_lines; | 1151 | *heightp = size.ts_lines; |
| 1138 | } | 1152 | } |
| 1139 | 1153 | ||
| 1140 | #else | 1154 | #elif defined WINDOWSNT |
| 1141 | #ifdef MSDOS | 1155 | |
| 1156 | CONSOLE_SCREEN_BUFFER_INFO info; | ||
| 1157 | if (GetConsoleScreenBufferInfo (GetStdHandle (STD_OUTPUT_HANDLE), &info)) | ||
| 1158 | { | ||
| 1159 | *widthp = info.srWindow.Right - info.srWindow.Left + 1; | ||
| 1160 | *heightp = info.srWindow.Bottom - info.srWindow.Top + 1; | ||
| 1161 | } | ||
| 1162 | else | ||
| 1163 | *widthp = *heightp = 0; | ||
| 1164 | |||
| 1165 | #elif defined MSDOS | ||
| 1166 | |||
| 1142 | *widthp = ScreenCols (); | 1167 | *widthp = ScreenCols (); |
| 1143 | *heightp = ScreenRows (); | 1168 | *heightp = ScreenRows (); |
| 1169 | |||
| 1144 | #else /* system doesn't know size */ | 1170 | #else /* system doesn't know size */ |
| 1171 | |||
| 1145 | *widthp = 0; | 1172 | *widthp = 0; |
| 1146 | *heightp = 0; | 1173 | *heightp = 0; |
| 1174 | |||
| 1147 | #endif | 1175 | #endif |
| 1148 | #endif /* not SunOS-style */ | ||
| 1149 | #endif /* not BSD-style */ | ||
| 1150 | } | 1176 | } |
| 1151 | 1177 | ||
| 1152 | /* Set the logical window size associated with descriptor FD | 1178 | /* Set the logical window size associated with descriptor FD |