summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2020-07-17 03:51:33 +0000
committerDamien Miller <djm@cvs.openbsd.org>2020-07-17 03:51:33 +0000
commit637ce5385417b4b24de193b1f7c7a8c2ebce057f (patch)
treefa5573f0787b336e274e0efa83766adbfcb51d78 /usr.bin
parent13a0dcff571ffb601fae462e963f690e3b3bb072 (diff)
log error message for process_write() write failures
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/ssh/sftp-server.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.bin/ssh/sftp-server.c b/usr.bin/ssh/sftp-server.c
index 9ce13ab90f1..9c0a9043105 100644
--- a/usr.bin/ssh/sftp-server.c
+++ b/usr.bin/ssh/sftp-server.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sftp-server.c,v 1.118 2020/06/22 05:52:05 djm Exp $ */
+/* $OpenBSD: sftp-server.c,v 1.119 2020/07/17 03:51:32 djm Exp $ */
/*
* Copyright (c) 2000-2004 Markus Friedl. All rights reserved.
*
@@ -791,18 +791,19 @@ process_write(u_int32_t id)
if (!(handle_to_flags(handle) & O_APPEND) &&
lseek(fd, off, SEEK_SET) == -1) {
status = errno_to_portable(errno);
- error("process_write: seek failed");
+ error("%s: seek failed", __func__);
} else {
/* XXX ATOMICIO ? */
ret = write(fd, data, len);
if (ret == -1) {
- error("process_write: write failed");
+ error("%s: write: %s", __func__,
+ strerror(errno));
status = errno_to_portable(errno);
} else if ((size_t)ret == len) {
status = SSH2_FX_OK;
handle_update_write(handle, ret);
} else {
- debug2("nothing at all written");
+ debug2("%s: nothing at all written", __func__);
status = SSH2_FX_FAILURE;
}
}