diff --git a/src/storage/sftp/read.c b/src/storage/sftp/read.c index 17285cfb1..8c8e39a20 100644 --- a/src/storage/sftp/read.c +++ b/src/storage/sftp/read.c @@ -193,7 +193,7 @@ storageReadSftpClose(THIS_VOID) if (this->sftpHandle != NULL) { - int rc = 0; + int rc; Wait *const wait = waitNew(this->timeout); // Close the file @@ -205,7 +205,7 @@ storageReadSftpClose(THIS_VOID) waitFree(wait); - if (rc) + if (rc != 0) { THROW_FMT( FileCloseError, diff --git a/src/storage/sftp/write.c b/src/storage/sftp/write.c index 3eb456477..17fb5a9af 100644 --- a/src/storage/sftp/write.c +++ b/src/storage/sftp/write.c @@ -189,7 +189,7 @@ storageWriteSftpUnlinkExisting(THIS_VOID) waitFree(wait); - if (rc) + if (rc != 0) { storageSftpEvalLibSsh2Error( rc, libssh2_sftp_last_error(this->sftpSession), &FileRemoveError, @@ -227,7 +227,7 @@ storageWriteSftpRename(THIS_VOID) waitFree(wait); - if (rc) + if (rc != 0) { storageSftpEvalLibSsh2Error( rc, libssh2_sftp_last_error(this->sftpSession), &FileRemoveError, @@ -271,7 +271,7 @@ storageWriteSftpClose(THIS_VOID) waitFree(wait); - if (rc) + if (rc != 0) THROW_FMT(FileSyncError, STORAGE_ERROR_WRITE_SYNC, strZ(this->nameTmp)); } @@ -313,7 +313,7 @@ storageWriteSftpClose(THIS_VOID) waitFree(wait); - if (rc) + if (rc != 0) { // Some/most sftp servers will not rename over an existing file, in testing this returned LIBSSH2_FX_FAILURE if (rc == LIBSSH2_ERROR_SFTP_PROTOCOL && libssh2_sftp_last_error(this->sftpSession) == LIBSSH2_FX_FAILURE) diff --git a/test/src/common/harnessLibSsh2.c b/test/src/common/harnessLibSsh2.c index 3885ee38c..9f7361214 100644 --- a/test/src/common/harnessLibSsh2.c +++ b/test/src/common/harnessLibSsh2.c @@ -424,7 +424,7 @@ libssh2_sftp_symlink_ex( } MEM_CONTEXT_TEMP_END(); - int rc = 0; + int rc; switch (link_type) {