return cmd;
}
-static void do_sftp_init(void)
+static int do_sftp_init(void)
{
/*
* Do protocol initialisation.
if (!fxp_init()) {
fprintf(stderr,
"Fatal: unable to initialise SFTP: %s\n", fxp_error());
- return;
+ return 1; /* failure */
}
/*
printf("Remote working directory is %s\n", homedir);
}
pwd = dupstr(homedir);
+ return 0;
}
void do_sftp(int mode, int modeflags, char *batchfile)
if (userhost) {
if (psftp_connect(userhost, user, portnumber))
return 1;
- do_sftp_init();
+ if (do_sftp_init())
+ return 1;
} else {
printf("psftp: no hostname specified; use \"open host.name\""
" to connect\n");