Ticket #60 (closed defect)

Opened 10 years ago

Last modified 9 years ago

libssh2_channel_get_exit_status should not fail with 0

Reported by: roadrunn Owned by:
Priority: normal Milestone:
Component: API Version:
Keywords: Cc: roadrunn
Blocked By: Blocks:


When using libssh2_channel_get_exit_status to check the return code of an exec'ed process it returns 0 on failure. The problem is most applications and scripts will return 0 on success. I think tht if libssh2_channel_get_exit_status has a failure it should return -1, or some other value that wouldn't be confused with the exec'ed process' return code. I think if we at least stay away from 0 and 1 that would be a good start.

Change History

comment:1 Changed 10 years ago by anonymous

Logged In: NO

The only reliable option is to signal failure, or the return status, out of band. Compare how the waitpid() system call works.


Note: See TracTickets for help on using tickets.