show more verbose error when SCP send fails
This commit is contained in:
parent
bd5519c7a2
commit
b4f12e153a
@ -147,7 +147,10 @@ int main(int argc, char *argv[])
|
|||||||
(unsigned long)fileinfo.st_size);
|
(unsigned long)fileinfo.st_size);
|
||||||
|
|
||||||
if (!channel) {
|
if (!channel) {
|
||||||
fprintf(stderr, "Unable to open a session\n");
|
char *errmsg;
|
||||||
|
int *errlen;
|
||||||
|
int err = libssh2_session_last_error(session, &errmsg, &errlen, 0);
|
||||||
|
fprintf(stderr, "Unable to open a session: (%d) %s\n", err, errmsg);
|
||||||
goto shutdown;
|
goto shutdown;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user