Patch 8.0.0588
Problem:    job_stop() often assumes the channel will be closed, while the job
            may not actually be stopped. (Martin Gammelsæter)
Solution:   Only assume the job stops on "kill".  Don't send a signal if the
            job has already ended. (closes #1632)
Files:      src/channel.c


*** ../vim-8.0.0587/src/channel.c       2017-04-07 14:01:54.844119764 +0200
--- src/channel.c       2017-04-28 20:46:30.374968371 +0200
***************
*** 5148,5159 ****
            return 0;
        }
      }
      ch_logs(job->jv_channel, "Stopping job with '%s'", (char *)arg);
      if (mch_stop_job(job, arg) == FAIL)
        return 0;
  
!     /* Assume that "hup" does not kill the job. */
!     if (job->jv_channel != NULL && STRCMP(arg, "hup") != 0)
        job->jv_channel->ch_job_killed = TRUE;
  
      /* We don't try freeing the job, obviously the caller still has a
--- 5148,5164 ----
            return 0;
        }
      }
+     if (job->jv_status == JOB_ENDED)
+     {
+       ch_log(job->jv_channel, "Job has already ended, job_stop() skipped");
+       return 0;
+     }
      ch_logs(job->jv_channel, "Stopping job with '%s'", (char *)arg);
      if (mch_stop_job(job, arg) == FAIL)
        return 0;
  
!     /* Assume that only "kill" will kill the job. */
!     if (job->jv_channel != NULL && STRCMP(arg, "kill") == 0)
        job->jv_channel->ch_job_killed = TRUE;
  
      /* We don't try freeing the job, obviously the caller still has a
*** ../vim-8.0.0587/src/version.c       2017-04-28 15:45:42.384360243 +0200
--- src/version.c       2017-04-28 20:46:04.451125603 +0200
***************
*** 766,767 ****
--- 766,769 ----
  {   /* Add new patch number below this line */
+ /**/
+     588,
  /**/

-- 
My girlfriend told me I should be more affectionate.
So I got TWO girlfriends.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui