aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeoff Voelker1995-05-26 05:26:17 +0000
committerGeoff Voelker1995-05-26 05:26:17 +0000
commitbd4a449f55414ff24e048de268ec50f538857a64 (patch)
tree62c32da3bbe62a2db5418e5056dde2face14f8b7
parent5c2f36b24ae32f855b6196254dd8ca21346d181f (diff)
downloademacs-bd4a449f55414ff24e048de268ec50f538857a64.tar.gz
emacs-bd4a449f55414ff24e048de268ec50f538857a64.zip
(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.
-rw-r--r--src/w32.c35
1 files changed, 29 insertions, 6 deletions
diff --git a/src/w32.c b/src/w32.c
index 960110e4eb8..b4626071861 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -263,12 +263,12 @@ getpwnam (char *name)
263 user enter it, so we define EMACS_CONFIGURATION to invoke this runtime 263 user enter it, so we define EMACS_CONFIGURATION to invoke this runtime
264 routine. */ 264 routine. */
265 265
266static char configuration_buffer[16]; 266static char configuration_buffer[32];
267 267
268char * 268char *
269get_emacs_configuration (void) 269get_emacs_configuration (void)
270{ 270{
271 char *arch, *oem; 271 char *arch, *oem, *os;
272 272
273 /* Determine the processor type. */ 273 /* Determine the processor type. */
274 switch (get_processor_type ()) 274 switch (get_processor_type ())
@@ -297,7 +297,13 @@ get_emacs_configuration (void)
297 /* Let oem be "*" until we figure out how to decode the OEM field. */ 297 /* Let oem be "*" until we figure out how to decode the OEM field. */
298 oem = "*"; 298 oem = "*";
299 299
300 sprintf (configuration_buffer, "%s-%s-nt%d.%d", arch, oem, 300#ifdef WINDOWS95
301 os = "win";
302#else
303 os = "nt";
304#endif
305
306 sprintf (configuration_buffer, "%s-%s-%s%d.%d", arch, oem, os,
301 get_nt_major_version (), get_nt_minor_version ()); 307 get_nt_major_version (), get_nt_minor_version ());
302 return configuration_buffer; 308 return configuration_buffer;
303} 309}
@@ -422,8 +428,21 @@ void
422prepare_standard_handles (int in, int out, int err, HANDLE handles[4]) 428prepare_standard_handles (int in, int out, int err, HANDLE handles[4])
423{ 429{
424 HANDLE parent, stdin_save, stdout_save, stderr_save, err_handle; 430 HANDLE parent, stdin_save, stdout_save, stderr_save, err_handle;
425 431
432#ifdef WINDOWS95
433 /* The Win95 beta doesn't set the standard handles correctly.
434 Handicap subprocesses until we get a version that works correctly.
435 Undefining the subprocesses macro reveals other incompatibilities,
436 so, since we're expecting subprocs to work in the near future,
437 disable them here. */
438 report_file_error ("Subprocesses currently disabled on Win95", Qnil);
439#endif
440
426 parent = GetCurrentProcess (); 441 parent = GetCurrentProcess ();
442 stdin_save = GetStdHandle (STD_INPUT_HANDLE);
443 stdout_save = GetStdHandle (STD_OUTPUT_HANDLE);
444 stderr_save = GetStdHandle (STD_ERROR_HANDLE);
445
427 if (!DuplicateHandle (parent, 446 if (!DuplicateHandle (parent,
428 GetStdHandle (STD_INPUT_HANDLE), 447 GetStdHandle (STD_INPUT_HANDLE),
429 parent, 448 parent,
@@ -492,12 +511,16 @@ reset_standard_handles (int in, int out, int err, HANDLE handles[4])
492 HANDLE stdout_save = handles[1]; 511 HANDLE stdout_save = handles[1];
493 HANDLE stderr_save = handles[2]; 512 HANDLE stderr_save = handles[2];
494 HANDLE err_handle = handles[3]; 513 HANDLE err_handle = handles[3];
495 514 int i;
515
496 if (!SetStdHandle (STD_INPUT_HANDLE, stdin_save)) 516 if (!SetStdHandle (STD_INPUT_HANDLE, stdin_save))
497 report_file_error ("Resetting input handle", Qnil); 517 report_file_error ("Resetting input handle", Qnil);
498 518
499 if (!SetStdHandle (STD_OUTPUT_HANDLE, stdout_save)) 519 if (!SetStdHandle (STD_OUTPUT_HANDLE, stdout_save))
500 report_file_error ("Resetting output handle", Qnil); 520 {
521 i = GetLastError ();
522 report_file_error ("Resetting output handle", Qnil);
523 }
501 524
502 if (!SetStdHandle (STD_ERROR_HANDLE, stderr_save)) 525 if (!SetStdHandle (STD_ERROR_HANDLE, stderr_save))
503 report_file_error ("Resetting error handle", Qnil); 526 report_file_error ("Resetting error handle", Qnil);