From 6370782de7acd48cbfd916e963720915dc0cc92f Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Wed, 7 Jun 2023 07:12:58 +0100 Subject: [PATCH] PSFTP: make the 'close' subcommand return success. A user points out that it always returned failure, even if it succeeded. As a result, a 'psftp -b' script of the form open this.host do stuff close open that.host do stuff close would terminate at the first 'close', believing it to have failed, and PSFTP would exit with a failure status. (Not only that, but there would be no error message indicating _why_ PSFTP had closed, because when a command returns failure it's expected to have printed an error message already.) --- psftp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/psftp.c b/psftp.c index d8b5c400..08796837 100644 --- a/psftp.c +++ b/psftp.c @@ -1024,7 +1024,7 @@ int sftp_cmd_close(struct sftp_command *cmd) } do_sftp_cleanup(); - return 0; + return 1; } void list_directory_from_sftp_warn_unsorted(void)