summaryrefslogtreecommitdiff
path: root/src/file.c
diff options
context:
space:
mode:
authorRyo Nakamura <upa@haeena.net>2022-10-22 19:10:34 +0900
committerRyo Nakamura <upa@haeena.net>2022-10-22 19:10:34 +0900
commit273f4a84078b8cdb4fb781e09e3234a835f26958 (patch)
tree80b4aa6dab08c5e269e840ea138c9724b439dc49 /src/file.c
parent54dc6c85a3bd02def57e09b70089b435189fef25 (diff)
fix
Diffstat (limited to 'src/file.c')
-rw-r--r--src/file.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/file.c b/src/file.c
index 6bc7b65..39c642c 100644
--- a/src/file.c
+++ b/src/file.c
@@ -607,7 +607,7 @@ static int chunk_copy_local_to_remote(struct chunk *c, sftp_session sftp, size_t
for (remaind2 = ret; remaind2 > 0;) {
ret2 = sftp_write(sf, buf + (ret - remaind2), remaind2);
- if (ret2 < 2) {
+ if (ret2 < 0) {
pr_err("failed to write to %s: %s\n", f->dst_path,
ssh_get_error(sftp_ssh(sftp)));
ret = -1;
@@ -667,7 +667,7 @@ static int chunk_copy_remote_to_local(struct chunk *c, sftp_session sftp, size_t
for (remaind2 = ret; remaind2 > 0;) {
ret2 = write(fd, buf + (ret - remaind2), remaind2);
- if (ret2 < 2) {
+ if (ret2 < 0) {
pr_err("failed to write to %s: %s\n", f->dst_path,
strerrno());
ret = -1;