aboutsummaryrefslogtreecommitdiffstats
path: root/src/msdos.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/msdos.c')
-rw-r--r--src/msdos.c36
1 files changed, 19 insertions, 17 deletions
diff --git a/src/msdos.c b/src/msdos.c
index 84e8c39ec0c..62411ea2f6d 100644
--- a/src/msdos.c
+++ b/src/msdos.c
@@ -59,6 +59,12 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
59#include <libc/dosio.h> /* for _USE_LFN */ 59#include <libc/dosio.h> /* for _USE_LFN */
60#include <conio.h> /* for cputs */ 60#include <conio.h> /* for cputs */
61 61
62#if (__DJGPP__ + (__DJGPP_MINOR__ > 3)) >= 3
63#define SYS_ENVIRON _environ
64#else
65#define SYS_ENVIRON environ
66#endif
67
62#include "msdos.h" 68#include "msdos.h"
63#include "systime.h" 69#include "systime.h"
64#include "frame.h" 70#include "frame.h"
@@ -422,8 +428,6 @@ static unsigned long screen_old_address = 0;
422/* Segment and offset of the virtual screen. If 0, DOS/V is NOT loaded. */ 428/* Segment and offset of the virtual screen. If 0, DOS/V is NOT loaded. */
423static unsigned short screen_virtual_segment = 0; 429static unsigned short screen_virtual_segment = 0;
424static unsigned short screen_virtual_offset = 0; 430static unsigned short screen_virtual_offset = 0;
425extern Lisp_Object Qcursor_type;
426extern Lisp_Object Qbar, Qhbar;
427 431
428/* The screen colors of the current frame, which serve as the default 432/* The screen colors of the current frame, which serve as the default
429 colors for newly-created frames. */ 433 colors for newly-created frames. */
@@ -1384,11 +1388,6 @@ IT_delete_glyphs (struct frame *f, int n)
1384 1388
1385/* This was copied from xfaces.c */ 1389/* This was copied from xfaces.c */
1386 1390
1387extern Lisp_Object Qbackground_color;
1388extern Lisp_Object Qforeground_color;
1389Lisp_Object Qreverse;
1390extern Lisp_Object Qtitle;
1391
1392/* IT_set_terminal_modes is called when emacs is started, 1391/* IT_set_terminal_modes is called when emacs is started,
1393 resumed, and whenever the screen is redrawn! */ 1392 resumed, and whenever the screen is redrawn! */
1394 1393
@@ -3710,7 +3709,7 @@ dos_ttcooked (void)
3710 file TEMPOUT and stderr to TEMPERR. */ 3709 file TEMPOUT and stderr to TEMPERR. */
3711 3710
3712int 3711int
3713run_msdos_command (unsigned char **argv, const char *working_dir, 3712run_msdos_command (char **argv, const char *working_dir,
3714 int tempin, int tempout, int temperr, char **envv) 3713 int tempin, int tempout, int temperr, char **envv)
3715{ 3714{
3716 char *saveargv1, *saveargv2, *lowcase_argv0, *pa, *pl; 3715 char *saveargv1, *saveargv2, *lowcase_argv0, *pa, *pl;
@@ -3796,8 +3795,8 @@ run_msdos_command (unsigned char **argv, const char *working_dir,
3796 ; 3795 ;
3797 if (*cmnd) 3796 if (*cmnd)
3798 { 3797 {
3799 extern char **environ; 3798 extern char **SYS_ENVIRON;
3800 char **save_env = environ; 3799 char **save_env = SYS_ENVIRON;
3801 int save_system_flags = __system_flags; 3800 int save_system_flags = __system_flags;
3802 3801
3803 /* Request the most powerful version of `system'. We need 3802 /* Request the most powerful version of `system'. We need
@@ -3809,16 +3808,16 @@ run_msdos_command (unsigned char **argv, const char *working_dir,
3809 | __system_handle_null_commands 3808 | __system_handle_null_commands
3810 | __system_emulate_chdir); 3809 | __system_emulate_chdir);
3811 3810
3812 environ = envv; 3811 SYS_ENVIRON = envv;
3813 result = system (cmnd); 3812 result = system (cmnd);
3814 __system_flags = save_system_flags; 3813 __system_flags = save_system_flags;
3815 environ = save_env; 3814 SYS_ENVIRON = save_env;
3816 } 3815 }
3817 else 3816 else
3818 result = 0; /* emulate Unixy shell behavior with empty cmd line */ 3817 result = 0; /* emulate Unixy shell behavior with empty cmd line */
3819 } 3818 }
3820 else 3819 else
3821 result = spawnve (P_WAIT, argv[0], (char **)argv, envv); 3820 result = spawnve (P_WAIT, argv[0], argv, envv);
3822 3821
3823 dup2 (inbak, 0); 3822 dup2 (inbak, 0);
3824 dup2 (outbak, 1); 3823 dup2 (outbak, 1);
@@ -4085,11 +4084,14 @@ sys_select (int nfds, fd_set *rfds, fd_set *wfds, fd_set *efds,
4085 gettime (&t); 4084 gettime (&t);
4086 clnow = make_timespec (t.tv_sec, t.tv_nsec); 4085 clnow = make_timespec (t.tv_sec, t.tv_nsec);
4087 cldiff = timespec_sub (clnow, cllast); 4086 cldiff = timespec_sub (clnow, cllast);
4087 /* Stop when timeout value is about to cross zero. */
4088 if (timespec_cmp (*timeout, cldiff) <= 0)
4089 {
4090 timeout->tv_sec = 0;
4091 timeout->tv_nsec = 0;
4092 return 0;
4093 }
4088 *timeout = timespec_sub (*timeout, cldiff); 4094 *timeout = timespec_sub (*timeout, cldiff);
4089
4090 /* Stop when timeout value crosses zero. */
4091 if (timespec_sign (*timeout) <= 0)
4092 return 0;
4093 cllast = clnow; 4095 cllast = clnow;
4094 dos_yield_time_slice (); 4096 dos_yield_time_slice ();
4095 } 4097 }