diff options
author | djm@openbsd.org <djm@openbsd.org> | 2015-05-28 04:50:53 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2015-05-28 18:54:55 +1000 |
commit | 9cc6842493fbf23025ccc1edab064869640d3bec (patch) | |
tree | c675b0be22ede7ef837431882cdd5da59ed459f4 /sftp-client.c | |
parent | d1958793a0072c22be26d136dbda5ae263e717a0 (diff) |
upstream commit
add error message on ftruncate failure; bz#2176
Upstream-ID: cbcc606e0b748520c74a210d8f3cc9718d3148cf
Diffstat (limited to 'sftp-client.c')
-rw-r--r-- | sftp-client.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sftp-client.c b/sftp-client.c index d12ca26ec..5dbeb47c0 100644 --- a/sftp-client.c +++ b/sftp-client.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sftp-client.c,v 1.119 2015/05/23 14:28:37 jsg Exp $ */ | 1 | /* $OpenBSD: sftp-client.c,v 1.120 2015/05/28 04:50:53 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org> | 3 | * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org> |
4 | * | 4 | * |
@@ -1385,7 +1385,9 @@ do_download(struct sftp_conn *conn, const char *remote_path, | |||
1385 | "server reordered requests", local_path); | 1385 | "server reordered requests", local_path); |
1386 | } | 1386 | } |
1387 | debug("truncating at %llu", (unsigned long long)highwater); | 1387 | debug("truncating at %llu", (unsigned long long)highwater); |
1388 | ftruncate(local_fd, highwater); | 1388 | if (ftruncate(local_fd, highwater) == -1) |
1389 | error("ftruncate \"%s\": %s", local_path, | ||
1390 | strerror(errno)); | ||
1389 | } | 1391 | } |
1390 | if (read_error) { | 1392 | if (read_error) { |
1391 | error("Couldn't read from remote file \"%s\" : %s", | 1393 | error("Couldn't read from remote file \"%s\" : %s", |