Mercurial > vim
comparison src/eval.c @ 8259:99a70c3b902f v7.4.1422
commit https://github.com/vim/vim/commit/46c85439c966d7ed39fb3d711d4d6c61ac964647
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Feb 26 11:17:46 2016 +0100
patch 7.4.1422
Problem: Error when reading fails uses wrong errno. Keeping channel open
after job stops results in test failing.
Solution: Move the error up. Add ch_job_killed.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Fri, 26 Feb 2016 11:30:05 +0100 |
parents | c4ffdda8cdfd |
children | 108d30ed34ba |
comparison
equal
deleted
inserted
replaced
8258:c753d5773e64 | 8259:99a70c3b902f |
---|---|
7768 job_free(job_T *job) | 7768 job_free(job_T *job) |
7769 { | 7769 { |
7770 # ifdef FEAT_CHANNEL | 7770 # ifdef FEAT_CHANNEL |
7771 if (job->jv_channel != NULL) | 7771 if (job->jv_channel != NULL) |
7772 { | 7772 { |
7773 /* The channel doesn't count as a references for the job, we need to | 7773 /* The link from the channel to the job doesn't count as a reference, |
7774 * NULL the reference when the job is freed. */ | 7774 * thus don't decrement the refcount of the job. The reference from |
7775 * the job to the channel does count the refrence, decrement it and | |
7776 * NULL the reference. We don't set ch_job_killed, unreferencing the | |
7777 * job doesn't mean it stops running. */ | |
7775 job->jv_channel->ch_job = NULL; | 7778 job->jv_channel->ch_job = NULL; |
7776 channel_unref(job->jv_channel); | 7779 channel_unref(job->jv_channel); |
7777 } | 7780 } |
7778 # endif | 7781 # endif |
7779 mch_clear_job(job); | 7782 mch_clear_job(job); |
15159 } | 15162 } |
15160 } | 15163 } |
15161 if (mch_stop_job(job, arg) == FAIL) | 15164 if (mch_stop_job(job, arg) == FAIL) |
15162 rettv->vval.v_number = 0; | 15165 rettv->vval.v_number = 0; |
15163 else | 15166 else |
15167 { | |
15164 rettv->vval.v_number = 1; | 15168 rettv->vval.v_number = 1; |
15169 /* Assume that "hup" does not kill the job. */ | |
15170 if (job->jv_channel != NULL && STRCMP(arg, "hup") != 0) | |
15171 job->jv_channel->ch_job_killed = TRUE; | |
15172 } | |
15173 /* We don't try freeing the job, obviously the caller still has a | |
15174 * reference to it. */ | |
15165 } | 15175 } |
15166 } | 15176 } |
15167 #endif | 15177 #endif |
15168 | 15178 |
15169 /* | 15179 /* |