Mercurial > emacs
changeset 11941:cb26a4ca0e10
(configuration_buffer): Increase size.
(get_emacs_configuration) [WINDOWS95]: Use appropriate string.
(prepare_standard_handles) [WINDOWS95]: Disable subprocesses.
(reset_standard_handles): Check error number on failure.
author | Geoff Voelker <voelker@cs.washington.edu> |
---|---|
date | Fri, 26 May 1995 05:26:17 +0000 |
parents | 4636a3916e01 |
children | 04cc0b15ef74 |
files | src/w32.c |
diffstat | 1 files changed, 29 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/w32.c Fri May 26 05:25:04 1995 +0000 +++ b/src/w32.c Fri May 26 05:26:17 1995 +0000 @@ -263,12 +263,12 @@ user enter it, so we define EMACS_CONFIGURATION to invoke this runtime routine. */ -static char configuration_buffer[16]; +static char configuration_buffer[32]; char * get_emacs_configuration (void) { - char *arch, *oem; + char *arch, *oem, *os; /* Determine the processor type. */ switch (get_processor_type ()) @@ -297,7 +297,13 @@ /* Let oem be "*" until we figure out how to decode the OEM field. */ oem = "*"; - sprintf (configuration_buffer, "%s-%s-nt%d.%d", arch, oem, +#ifdef WINDOWS95 + os = "win"; +#else + os = "nt"; +#endif + + sprintf (configuration_buffer, "%s-%s-%s%d.%d", arch, oem, os, get_nt_major_version (), get_nt_minor_version ()); return configuration_buffer; } @@ -422,8 +428,21 @@ prepare_standard_handles (int in, int out, int err, HANDLE handles[4]) { HANDLE parent, stdin_save, stdout_save, stderr_save, err_handle; - + +#ifdef WINDOWS95 + /* The Win95 beta doesn't set the standard handles correctly. + Handicap subprocesses until we get a version that works correctly. + Undefining the subprocesses macro reveals other incompatibilities, + so, since we're expecting subprocs to work in the near future, + disable them here. */ + report_file_error ("Subprocesses currently disabled on Win95", Qnil); +#endif + parent = GetCurrentProcess (); + stdin_save = GetStdHandle (STD_INPUT_HANDLE); + stdout_save = GetStdHandle (STD_OUTPUT_HANDLE); + stderr_save = GetStdHandle (STD_ERROR_HANDLE); + if (!DuplicateHandle (parent, GetStdHandle (STD_INPUT_HANDLE), parent, @@ -492,12 +511,16 @@ HANDLE stdout_save = handles[1]; HANDLE stderr_save = handles[2]; HANDLE err_handle = handles[3]; - + int i; + if (!SetStdHandle (STD_INPUT_HANDLE, stdin_save)) report_file_error ("Resetting input handle", Qnil); if (!SetStdHandle (STD_OUTPUT_HANDLE, stdout_save)) - report_file_error ("Resetting output handle", Qnil); + { + i = GetLastError (); + report_file_error ("Resetting output handle", Qnil); + } if (!SetStdHandle (STD_ERROR_HANDLE, stderr_save)) report_file_error ("Resetting error handle", Qnil);