Inherit query-on-exit flag to stderr process (Bug#30031)
* src/process.c (Fmake_process): Have the pipe process honor the parent's query-on-exit flag. * test/src/process-tests.el (make-process/noquery-stderr): New test.
This commit is contained in:
parent
3efb1e7def
commit
9c2b11484f
2 changed files with 25 additions and 2 deletions
|
@ -1686,6 +1686,8 @@ usage: (make-process &rest ARGS) */)
|
||||||
if (!NILP (program))
|
if (!NILP (program))
|
||||||
CHECK_STRING (program);
|
CHECK_STRING (program);
|
||||||
|
|
||||||
|
bool query_on_exit = NILP (Fplist_get (contact, QCnoquery));
|
||||||
|
|
||||||
stderrproc = Qnil;
|
stderrproc = Qnil;
|
||||||
xstderr = Fplist_get (contact, QCstderr);
|
xstderr = Fplist_get (contact, QCstderr);
|
||||||
if (PROCESSP (xstderr))
|
if (PROCESSP (xstderr))
|
||||||
|
@ -1701,7 +1703,9 @@ usage: (make-process &rest ARGS) */)
|
||||||
QCname,
|
QCname,
|
||||||
concat2 (name, build_string (" stderr")),
|
concat2 (name, build_string (" stderr")),
|
||||||
QCbuffer,
|
QCbuffer,
|
||||||
Fget_buffer_create (xstderr));
|
Fget_buffer_create (xstderr),
|
||||||
|
QCnoquery,
|
||||||
|
query_on_exit ? Qnil : Qt);
|
||||||
}
|
}
|
||||||
|
|
||||||
proc = make_process (name);
|
proc = make_process (name);
|
||||||
|
@ -1715,7 +1719,7 @@ usage: (make-process &rest ARGS) */)
|
||||||
pset_filter (XPROCESS (proc), Fplist_get (contact, QCfilter));
|
pset_filter (XPROCESS (proc), Fplist_get (contact, QCfilter));
|
||||||
pset_command (XPROCESS (proc), Fcopy_sequence (command));
|
pset_command (XPROCESS (proc), Fcopy_sequence (command));
|
||||||
|
|
||||||
if (tem = Fplist_get (contact, QCnoquery), !NILP (tem))
|
if (!query_on_exit)
|
||||||
XPROCESS (proc)->kill_without_query = 1;
|
XPROCESS (proc)->kill_without_query = 1;
|
||||||
if (tem = Fplist_get (contact, QCstop), !NILP (tem))
|
if (tem = Fplist_get (contact, QCstop), !NILP (tem))
|
||||||
pset_command (XPROCESS (proc), Qt);
|
pset_command (XPROCESS (proc), Qt);
|
||||||
|
|
|
@ -162,5 +162,24 @@
|
||||||
(error nil))))
|
(error nil))))
|
||||||
(should (equal path samepath))))
|
(should (equal path samepath))))
|
||||||
|
|
||||||
|
(ert-deftest make-process/noquery-stderr ()
|
||||||
|
"Checks that Bug#30031 is fixed."
|
||||||
|
(skip-unless (executable-find "sleep"))
|
||||||
|
(with-temp-buffer
|
||||||
|
(let* ((previous-processes (process-list))
|
||||||
|
(process (make-process :name "sleep"
|
||||||
|
:command '("sleep" "1h")
|
||||||
|
:noquery t
|
||||||
|
:connection-type 'pipe
|
||||||
|
:stderr (current-buffer))))
|
||||||
|
(unwind-protect
|
||||||
|
(let ((new-processes (cl-set-difference (process-list)
|
||||||
|
previous-processes
|
||||||
|
:test #'eq)))
|
||||||
|
(should new-processes)
|
||||||
|
(dolist (process new-processes)
|
||||||
|
(should-not (process-query-on-exit-flag process))))
|
||||||
|
(kill-process process)))))
|
||||||
|
|
||||||
(provide 'process-tests)
|
(provide 'process-tests)
|
||||||
;; process-tests.el ends here.
|
;; process-tests.el ends here.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue