[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Patch] channel_get_exit_status always return -1

Hi Vic,

Thanks for your patch, there is indeed a problem. But your patch does not resolve it the clean way. When a channel has been closed, the optional exit_status message can't come anymore, hence the return -1 in the code (simply removing the test may block the function forever if no exit status is sent). I replaced it by a break; so it returns whatever value was saved.


Vic Lee a écrit :

I just found out that the channel_get_exit_status() function always
return -1. What I saw in the codes is that, the channel is supposed to
close first before we can call channel_get_exit_status; which is true
because it's checking "channel->local_eof == 0" in the first line of
that function.

But if I have to close the channel, why another checking "channel->open
== 0" to check whether the channel is open? So I tried to remove these
three lines, and finally it's working as expected.



Re: [Patch] channel_get_exit_status always return -1Vic Lee <llyzs@xxxxxxx>
[Patch] channel_get_exit_status always return -1Vic Lee <llyzs@xxxxxxx>
Archive administrator: postmaster@lists.cynapses.org