aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrew Innes1998-12-28 19:33:57 +0000
committerAndrew Innes1998-12-28 19:33:57 +0000
commit82e7c0a907a11f84d9eaf9750266db104974e9ab (patch)
tree33185e7572ed3455e70738e9cdb0ad2b97f00a73 /src
parent467af476c1ba9c36f6a621fde0e7cfd531b95ec3 (diff)
downloademacs-82e7c0a907a11f84d9eaf9750266db104974e9ab.tar.gz
emacs-82e7c0a907a11f84d9eaf9750266db104974e9ab.zip
(Vw32_start_process_inherit_error_mode): New variable.
(create_child): Use it. (syms_of_ntproc): Defvar it. Also fix docstrings for w32-start-process-share-console and w32-start-process-show-window.
Diffstat (limited to 'src')
-rw-r--r--src/w32proc.c30
1 files changed, 22 insertions, 8 deletions
diff --git a/src/w32proc.c b/src/w32proc.c
index f02419e9ad3..81cdcbf93bf 100644
--- a/src/w32proc.c
+++ b/src/w32proc.c
@@ -63,6 +63,11 @@ Lisp_Object Vw32_start_process_show_window;
63 consoles also allows Emacs to cleanly terminate process groups. */ 63 consoles also allows Emacs to cleanly terminate process groups. */
64Lisp_Object Vw32_start_process_share_console; 64Lisp_Object Vw32_start_process_share_console;
65 65
66/* Control whether create_child cause the process to inherit Emacs'
67 error mode setting. The default is t, to minimize the possibility of
68 subprocesses blocking when accessing unmounted drives. */
69Lisp_Object Vw32_start_process_inherit_error_mode;
70
66/* Time to sleep before reading from a subprocess output pipe - this 71/* Time to sleep before reading from a subprocess output pipe - this
67 avoids the inefficiency of frequently reading small amounts of data. 72 avoids the inefficiency of frequently reading small amounts of data.
68 This is primarily necessary for handling DOS processes on Windows 95, 73 This is primarily necessary for handling DOS processes on Windows 95,
@@ -304,6 +309,7 @@ create_child (char *exe, char *cmdline, char *env,
304 STARTUPINFO start; 309 STARTUPINFO start;
305 SECURITY_ATTRIBUTES sec_attrs; 310 SECURITY_ATTRIBUTES sec_attrs;
306 SECURITY_DESCRIPTOR sec_desc; 311 SECURITY_DESCRIPTOR sec_desc;
312 DWORD flags;
307 char dir[ MAXPATHLEN ]; 313 char dir[ MAXPATHLEN ];
308 314
309 if (cp == NULL) abort (); 315 if (cp == NULL) abort ();
@@ -334,13 +340,14 @@ create_child (char *exe, char *cmdline, char *env,
334 340
335 strcpy (dir, process_dir); 341 strcpy (dir, process_dir);
336 unixtodos_filename (dir); 342 unixtodos_filename (dir);
337 343
344 flags = (!NILP (Vw32_start_process_share_console)
345 ? CREATE_NEW_PROCESS_GROUP
346 : CREATE_NEW_CONSOLE);
347 if (NILP (Vw32_start_process_inherit_error_mode))
348 flags |= CREATE_DEFAULT_ERROR_MODE;
338 if (!CreateProcess (exe, cmdline, &sec_attrs, NULL, TRUE, 349 if (!CreateProcess (exe, cmdline, &sec_attrs, NULL, TRUE,
339 (!NILP (Vw32_start_process_share_console) 350 flags, env, dir, &start, &cp->procinfo))
340 ? CREATE_NEW_PROCESS_GROUP
341 : CREATE_NEW_CONSOLE),
342 env, dir,
343 &start, &cp->procinfo))
344 goto EH_Fail; 351 goto EH_Fail;
345 352
346 cp->pid = (int) cp->procinfo.dwProcessId; 353 cp->pid = (int) cp->procinfo.dwProcessId;
@@ -2069,13 +2076,13 @@ will be chosen based on the type of the program.");
2069 2076
2070 DEFVAR_LISP ("w32-start-process-show-window", 2077 DEFVAR_LISP ("w32-start-process-show-window",
2071 &Vw32_start_process_show_window, 2078 &Vw32_start_process_show_window,
2072 "When nil, processes started via start-process hide their windows.\n\ 2079 "When nil, new child processes hide their windows.\n\
2073When non-nil, they show their window in the method of their choice."); 2080When non-nil, they show their window in the method of their choice.");
2074 Vw32_start_process_show_window = Qnil; 2081 Vw32_start_process_show_window = Qnil;
2075 2082
2076 DEFVAR_LISP ("w32-start-process-share-console", 2083 DEFVAR_LISP ("w32-start-process-share-console",
2077 &Vw32_start_process_share_console, 2084 &Vw32_start_process_share_console,
2078 "When nil, processes started via start-process are given a new console.\n\ 2085 "When nil, new child processes are given a new console.\n\
2079When non-nil, they share the Emacs console; this has the limitation of\n\ 2086When non-nil, they share the Emacs console; this has the limitation of\n\
2080allowing only only DOS subprocess to run at a time (whether started directly\n\ 2087allowing only only DOS subprocess to run at a time (whether started directly\n\
2081or indirectly by Emacs), and preventing Emacs from cleanly terminating the\n\ 2088or indirectly by Emacs), and preventing Emacs from cleanly terminating the\n\
@@ -2083,6 +2090,13 @@ subprocess group, but may allow Emacs to interrupt a subprocess that doesn't\n\
2083otherwise respond to interrupts from Emacs."); 2090otherwise respond to interrupts from Emacs.");
2084 Vw32_start_process_share_console = Qnil; 2091 Vw32_start_process_share_console = Qnil;
2085 2092
2093 DEFVAR_LISP ("w32-start-process-inherit-error-mode",
2094 &Vw32_start_process_inherit_error_mode,
2095 "When nil, new child processes revert to the default error mode.\n\
2096When non-nil, they inherit their error mode setting from Emacs, which stops\n\
2097them blocking when trying to access unmounted drives etc.");
2098 Vw32_start_process_inherit_error_mode = Qt;
2099
2086 DEFVAR_INT ("w32-pipe-read-delay", &Vw32_pipe_read_delay, 2100 DEFVAR_INT ("w32-pipe-read-delay", &Vw32_pipe_read_delay,
2087 "Forced delay before reading subprocess output.\n\ 2101 "Forced delay before reading subprocess output.\n\
2088This is done to improve the buffering of subprocess output, by\n\ 2102This is done to improve the buffering of subprocess output, by\n\