process_stop: uv: do not close stdin first/explicitly #10584

- process_stop: do not close stdin explicitly. The "close stdin" step was from
  aa9cb48, before we fixed/reworked the SIGTERM timing logic. So it's probably
  outdated / no longer needed.
- win: jobstop: exit_code 15
   GetExitCodeProcess appears to return the used signal.
   https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-getexitcodeprocess

ref #10573
This commit is contained in:
Daniel Hahler 2019-08-01 13:55:06 +02:00 committed by Justin M. Keyes
parent 65578693b2
commit 41bb68b8e8
2 changed files with 4 additions and 8 deletions

View File

@ -223,10 +223,6 @@ void process_stop(Process *proc) FUNC_ATTR_NONNULL_ALL
switch (proc->type) { switch (proc->type) {
case kProcessTypeUv: case kProcessTypeUv:
// Close the process's stdin. If the process doesn't close its own
// stdout/stderr, they will be closed when it exits(possibly due to being
// terminated after a timeout)
stream_may_close(&proc->in);
os_proc_tree_kill(proc->pid, SIGTERM); os_proc_tree_kill(proc->pid, SIGTERM);
break; break;
case kProcessTypePty: case kProcessTypePty:

View File

@ -183,7 +183,7 @@ describe('jobs', function()
) )
nvim('command', "call jobstop(j)") nvim('command', "call jobstop(j)")
eq({'notification', 'stdout', {0, {''}}}, next_msg()) eq({'notification', 'stdout', {0, {''}}}, next_msg())
eq({'notification', 'exit', {0, 0}}, next_msg()) eq({'notification', 'exit', {0, iswin() and 15 or 0}}, next_msg())
end) end)
it('preserves NULs', function() it('preserves NULs', function()
@ -217,7 +217,7 @@ describe('jobs', function()
eq({'notification', 'stdout', {0, {'abc', 'xyz'}}}, next_msg()) eq({'notification', 'stdout', {0, {'abc', 'xyz'}}}, next_msg())
nvim('command', "call jobstop(j)") nvim('command', "call jobstop(j)")
eq({'notification', 'stdout', {0, {''}}}, next_msg()) eq({'notification', 'stdout', {0, {''}}}, next_msg())
eq({'notification', 'exit', {0, 0}}, next_msg()) eq({'notification', 'exit', {0, iswin() and 15 or 0}}, next_msg())
end) end)
it('preserves newlines', function() it('preserves newlines', function()
@ -234,7 +234,7 @@ describe('jobs', function()
next_msg()) next_msg())
nvim('command', "call jobstop(j)") nvim('command', "call jobstop(j)")
eq({'notification', 'stdout', {0, {''}}}, next_msg()) eq({'notification', 'stdout', {0, {''}}}, next_msg())
eq({'notification', 'exit', {0, 0}}, next_msg()) eq({'notification', 'exit', {0, iswin() and 15 or 0}}, next_msg())
end) end)
it('avoids sending final newline', function() it('avoids sending final newline', function()
@ -244,7 +244,7 @@ describe('jobs', function()
next_msg()) next_msg())
nvim('command', "call jobstop(j)") nvim('command', "call jobstop(j)")
eq({'notification', 'stdout', {0, {''}}}, next_msg()) eq({'notification', 'stdout', {0, {''}}}, next_msg())
eq({'notification', 'exit', {0, 0}}, next_msg()) eq({'notification', 'exit', {0, iswin() and 15 or 0}}, next_msg())
end) end)
it('closes the job streams with jobclose', function() it('closes the job streams with jobclose', function()