diff options
| author | Gerd Moellmann | 2000-01-25 15:56:42 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-01-25 15:56:42 +0000 |
| commit | 30904ab7d1284e4936506eb72ebf92e954b841c9 (patch) | |
| tree | 5d38e42d6aa14f0ce7364a8ef9110bc85d36312a /src/process.c | |
| parent | ab5d035833bac21b7811557ce90f87e0b1d564d8 (diff) | |
| download | emacs-30904ab7d1284e4936506eb72ebf92e954b841c9.tar.gz emacs-30904ab7d1284e4936506eb72ebf92e954b841c9.zip | |
(toplevel): Include atimer.h.
(create_process_1): Rewritten.
(create_process): Use atimers instead of alarm.
(wait_reading_process_input) [hpux]: Turn atimers off instead
of turning off SIGALRM.
(wait_reading_process_input): Turn off atimers instead off
calling stop_polling.
Diffstat (limited to 'src/process.c')
| -rw-r--r-- | src/process.c | 43 |
1 files changed, 24 insertions, 19 deletions
diff --git a/src/process.c b/src/process.c index 87699e299b3..71e244fc7fb 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -109,6 +109,7 @@ Boston, MA 02111-1307, USA. */ | |||
| 109 | #include "keyboard.h" | 109 | #include "keyboard.h" |
| 110 | #include "dispextern.h" | 110 | #include "dispextern.h" |
| 111 | #include "composite.h" | 111 | #include "composite.h" |
| 112 | #include "atimer.h" | ||
| 112 | 113 | ||
| 113 | #define max(a, b) ((a) > (b) ? (a) : (b)) | 114 | #define max(a, b) ((a) > (b) ? (a) : (b)) |
| 114 | 115 | ||
| @@ -1237,18 +1238,14 @@ start_process_unwind (proc) | |||
| 1237 | return Qnil; | 1238 | return Qnil; |
| 1238 | } | 1239 | } |
| 1239 | 1240 | ||
| 1240 | 1241 | void | |
| 1241 | SIGTYPE | 1242 | create_process_1 (timer) |
| 1242 | create_process_1 (signo) | 1243 | struct atimer *timer; |
| 1243 | int signo; | ||
| 1244 | { | 1244 | { |
| 1245 | #if defined (USG) && !defined (POSIX_SIGNALS) | 1245 | /* Nothing to do. */ |
| 1246 | /* USG systems forget handlers when they are used; | ||
| 1247 | must reestablish each time */ | ||
| 1248 | signal (signo, create_process_1); | ||
| 1249 | #endif /* USG */ | ||
| 1250 | } | 1246 | } |
| 1251 | 1247 | ||
| 1248 | |||
| 1252 | #if 0 /* This doesn't work; see the note before sigchld_handler. */ | 1249 | #if 0 /* This doesn't work; see the note before sigchld_handler. */ |
| 1253 | #ifdef USG | 1250 | #ifdef USG |
| 1254 | #ifdef SIGCHLD | 1251 | #ifdef SIGCHLD |
| @@ -1685,14 +1682,22 @@ create_process (process, new_argv, current_dir) | |||
| 1685 | /* If the subfork execv fails, and it exits, | 1682 | /* If the subfork execv fails, and it exits, |
| 1686 | this close hangs. I don't know why. | 1683 | this close hangs. I don't know why. |
| 1687 | So have an interrupt jar it loose. */ | 1684 | So have an interrupt jar it loose. */ |
| 1688 | stop_polling (); | 1685 | { |
| 1689 | signal (SIGALRM, create_process_1); | 1686 | struct atimer *timer; |
| 1690 | alarm (1); | 1687 | EMACS_TIME offset; |
| 1691 | XPROCESS (process)->subtty = Qnil; | 1688 | |
| 1692 | if (forkin >= 0) | 1689 | stop_polling (); |
| 1693 | emacs_close (forkin); | 1690 | EMACS_SET_SECS_USECS (offset, 1, 0); |
| 1694 | alarm (0); | 1691 | timer = start_atimer (ATIMER_RELATIVE, offset, create_process_1, 0); |
| 1695 | start_polling (); | 1692 | |
| 1693 | XPROCESS (process)->subtty = Qnil; | ||
| 1694 | if (forkin >= 0) | ||
| 1695 | emacs_close (forkin); | ||
| 1696 | |||
| 1697 | cancel_atimer (timer); | ||
| 1698 | start_polling (); | ||
| 1699 | } | ||
| 1700 | |||
| 1696 | if (forkin != forkout && forkout >= 0) | 1701 | if (forkin != forkout && forkout >= 0) |
| 1697 | emacs_close (forkout); | 1702 | emacs_close (forkout); |
| 1698 | 1703 | ||
| @@ -2369,7 +2374,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) | |||
| 2369 | Causes "poll: interrupted system call" messages when Emacs is run | 2374 | Causes "poll: interrupted system call" messages when Emacs is run |
| 2370 | in an X window | 2375 | in an X window |
| 2371 | Turn off periodic alarms (in case they are in use) */ | 2376 | Turn off periodic alarms (in case they are in use) */ |
| 2372 | stop_polling (); | 2377 | turn_on_atimers (0); |
| 2373 | #endif | 2378 | #endif |
| 2374 | 2379 | ||
| 2375 | while (1) | 2380 | while (1) |
| @@ -4745,7 +4750,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) | |||
| 4745 | 4750 | ||
| 4746 | /* Turn off periodic alarms (in case they are in use) | 4751 | /* Turn off periodic alarms (in case they are in use) |
| 4747 | because the select emulator uses alarms. */ | 4752 | because the select emulator uses alarms. */ |
| 4748 | stop_polling (); | 4753 | turn_on_atimers (0); |
| 4749 | 4754 | ||
| 4750 | while (1) | 4755 | while (1) |
| 4751 | { | 4756 | { |