aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGeoff Voelker1997-09-03 00:37:00 +0000
committerGeoff Voelker1997-09-03 00:37:00 +0000
commitad00c243fd85353e059d97c3001b261fa8aa0dd0 (patch)
treedb1315c5a7cad8af145c76e8b9ab28878573244a /src
parent084cd81029d68e2625b5966e62f572c7e7ad3b0d (diff)
downloademacs-ad00c243fd85353e059d97c3001b261fa8aa0dd0.tar.gz
emacs-ad00c243fd85353e059d97c3001b261fa8aa0dd0.zip
(sys_subshell) [DOS_NT]: Save and restore parent's
working directory. (sys_subshell) [WINDOWSNT]: Share MSDOS code. Don't take console. (init_sys_modes, reset_sys_modes) [WINDOWSNT]: Do it even with a read_socket_hook.
Diffstat (limited to 'src')
-rw-r--r--src/sysdep.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/src/sysdep.c b/src/sysdep.c
index 30a540c7d01..e8e1db80ec0 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -714,7 +714,7 @@ sys_suspend ()
714sys_subshell () 714sys_subshell ()
715{ 715{
716#ifndef VMS 716#ifndef VMS
717#ifdef MSDOS /* Demacs 1.1.2 91/10/20 Manabu Higashida */ 717#ifdef DOS_NT /* Demacs 1.1.2 91/10/20 Manabu Higashida */
718 int st; 718 int st;
719 char oldwd[MAXPATHLEN+1]; /* Fixed length is safe on MSDOS. */ 719 char oldwd[MAXPATHLEN+1]; /* Fixed length is safe on MSDOS. */
720#endif 720#endif
@@ -752,11 +752,7 @@ sys_subshell ()
752 str[len] = 0; 752 str[len] = 0;
753 xyzzy: 753 xyzzy:
754 754
755#ifdef WINDOWSNT 755#ifdef DOS_NT
756 pid = -1;
757#else /* not WINDOWSNT */
758
759#ifdef MSDOS
760 pid = 0; 756 pid = 0;
761#if __DJGPP__ > 1 757#if __DJGPP__ > 1
762 save_signal_handlers (saved_handlers); 758 save_signal_handlers (saved_handlers);
@@ -769,11 +765,10 @@ sys_subshell ()
769#endif 765#endif
770 766
771 if (pid == 0) 767 if (pid == 0)
772#endif /* not WINDOWSNT */
773 { 768 {
774 char *sh = 0; 769 char *sh = 0;
775 770
776#ifdef MSDOS /* MW, Aug 1993 */ 771#ifdef DOS_NT /* MW, Aug 1993 */
777 getwd (oldwd); 772 getwd (oldwd);
778 if (sh == 0) 773 if (sh == 0)
779 sh = (char *) egetenv ("SUSPEND"); /* KFS, 1994-12-14 */ 774 sh = (char *) egetenv ("SUSPEND"); /* KFS, 1994-12-14 */
@@ -811,10 +806,9 @@ sys_subshell ()
811#ifdef WINDOWSNT 806#ifdef WINDOWSNT
812 /* Waits for process completion */ 807 /* Waits for process completion */
813 pid = _spawnlp (_P_WAIT, sh, sh, NULL); 808 pid = _spawnlp (_P_WAIT, sh, sh, NULL);
809 chdir (oldwd);
814 if (pid == -1) 810 if (pid == -1)
815 write (1, "Can't execute subshell", 22); 811 write (1, "Can't execute subshell", 22);
816
817 take_console ();
818#else /* not WINDOWSNT */ 812#else /* not WINDOWSNT */
819 execlp (sh, sh, 0); 813 execlp (sh, sh, 0);
820 write (1, "Can't execute subshell", 22); 814 write (1, "Can't execute subshell", 22);
@@ -829,7 +823,7 @@ sys_subshell ()
829 synch_process_alive = 1; 823 synch_process_alive = 1;
830#endif 824#endif
831 825
832#ifndef MSDOS 826#ifndef DOS_NT
833 wait_for_termination (pid); 827 wait_for_termination (pid);
834#endif 828#endif
835 restore_signal_handlers (saved_handlers); 829 restore_signal_handlers (saved_handlers);
@@ -1550,7 +1544,13 @@ init_sys_modes ()
1550#ifdef HAVE_WINDOW_SYSTEM 1544#ifdef HAVE_WINDOW_SYSTEM
1551 /* Emacs' window system on MSDOG uses the `internal terminal' and therefore 1545 /* Emacs' window system on MSDOG uses the `internal terminal' and therefore
1552 needs the initialization code below. */ 1546 needs the initialization code below. */
1553 if (! read_socket_hook && EQ (Vwindow_system, Qnil)) 1547 if (EQ (Vwindow_system, Qnil)
1548#ifndef WINDOWSNT
1549 /* When running in tty mode on NT/Win95, we have a read_socket
1550 hook, but still need the rest of the initialization code below. */
1551 && (! read_socket_hook)
1552#endif
1553 )
1554#endif 1554#endif
1555 set_terminal_modes (); 1555 set_terminal_modes ();
1556 1556
@@ -1691,7 +1691,13 @@ reset_sys_modes ()
1691#ifdef HAVE_WINDOW_SYSTEM 1691#ifdef HAVE_WINDOW_SYSTEM
1692 /* Emacs' window system on MSDOG uses the `internal terminal' and therefore 1692 /* Emacs' window system on MSDOG uses the `internal terminal' and therefore
1693 needs the clean-up code below. */ 1693 needs the clean-up code below. */
1694 if (read_socket_hook || !EQ (Vwindow_system, Qnil)) 1694 if (!EQ (Vwindow_system, Qnil)
1695#ifndef WINDOWSNT
1696 /* When running in tty mode on NT/Win95, we have a read_socket
1697 hook, but still need the rest of the clean-up code below. */
1698 || read_socket_hook
1699#endif
1700 )
1695 return; 1701 return;
1696#endif 1702#endif
1697 cursor_to (FRAME_HEIGHT (selected_frame) - 1, 0); 1703 cursor_to (FRAME_HEIGHT (selected_frame) - 1, 0);