Yes Daniel I agree with you.

It would be better than modifying libssh2_channel_get_exit_status.
Also keeping the fetch status in a separate field from the actual shell
exit_status  would be a better, more clear api.

I will add the api and send in a patch.

-(Aalok)-



> Message: 2
> Date: Sun, 15 Jul 2012 23:55:36 +0200 (CEST)
> From: Daniel Stenberg <dan...@haxx.se>
> To: libssh2 development <libssh2-devel@cool.haxx.se>
> Subject: Re: libssh2_channel_get_exit_status
> Message-ID: <alpine.deb.2.00.1207152353050.5...@tvnag.unkk.fr>
> Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
>
> On Sun, 15 Jul 2012, aalok sood wrote:
>
> > * libssh2_channel_get_exit_status
> >
> > Now this makes sense, but sending back zero seems peculiar to me. zero
> is a
> > valid shell exit code, so we should send back something out of valid
> shell
> > exit codes in case channel is None. How about -1?
>
> We should rather make a new function that has a prototype like:
>
>   LIBSSH2_API int
>   libssh2_channel_get_exit_status2(LIBSSH2_CHANNEL *channel, uint32_t
> *status)
>
> Which then can return the proper value from the protocol in a value
> separate
> from the return code. Wouldn't that work fine for you?
>
> --
>
>

>   / daniel.haxx.se
>
>
> ------------------------------
>
> _______________________________________________
> libssh2-devel mailing list
> libssh2-devel@cool.haxx.se
> http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
>
>
> End of libssh2-devel Digest, Vol 38, Issue 7
> ********************************************
>
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

Reply via email to