summaryrefslogtreecommitdiff
path: root/msg.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2020-01-22 04:49:16 +0000
committerDamien Miller <djm@mindrot.org>2020-01-22 17:17:51 +1100
commit37d3b736506760e4ebc7fe56255f7b8ea823a00c (patch)
tree88623e3b40b6a2f862f3c555f0e66c17be390320 /msg.c
parente2031b05c74c98b141179ceab13a323cf17d01e5 (diff)
downloadopenssh-git-37d3b736506760e4ebc7fe56255f7b8ea823a00c.tar.gz
upstream: some __func__ and strerror(errno) here; no functional
change OpenBSD-Commit-ID: 6c3ddd5f848b99ea560b31d3fba99ceed66cef37
Diffstat (limited to 'msg.c')
-rw-r--r--msg.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/msg.c b/msg.c
index 1bd20f3d..99c25cd2 100644
--- a/msg.c
+++ b/msg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: msg.c,v 1.17 2018/07/09 21:59:10 markus Exp $ */
+/* $OpenBSD: msg.c,v 1.18 2020/01/22 04:49:16 djm Exp $ */
/*
* Copyright (c) 2002 Markus Friedl. All rights reserved.
*
@@ -47,16 +47,16 @@ ssh_msg_send(int fd, u_char type, struct sshbuf *m)
u_char buf[5];
u_int mlen = sshbuf_len(m);
- debug3("ssh_msg_send: type %u", (unsigned int)type & 0xff);
+ debug3("%s: type %u", __func__, (unsigned int)type & 0xff);
put_u32(buf, mlen + 1);
buf[4] = type; /* 1st byte of payload is mesg-type */
if (atomicio(vwrite, fd, buf, sizeof(buf)) != sizeof(buf)) {
- error("ssh_msg_send: write");
+ error("%s: write: %s", __func__, strerror(errno));
return (-1);
}
if (atomicio(vwrite, fd, sshbuf_mutable_ptr(m), mlen) != mlen) {
- error("ssh_msg_send: write");
+ error("%s: write: %s", __func__, strerror(errno));
return (-1);
}
return (0);
@@ -73,12 +73,12 @@ ssh_msg_recv(int fd, struct sshbuf *m)
if (atomicio(read, fd, buf, sizeof(buf)) != sizeof(buf)) {
if (errno != EPIPE)
- error("ssh_msg_recv: read: header");
+ error("%s: read header: %s", __func__, strerror(errno));
return (-1);
}
msg_len = get_u32(buf);
if (msg_len > 256 * 1024) {
- error("ssh_msg_recv: read: bad msg_len %u", msg_len);
+ error("%s: read: bad msg_len %u", __func__, msg_len);
return (-1);
}
sshbuf_reset(m);
@@ -87,7 +87,7 @@ ssh_msg_recv(int fd, struct sshbuf *m)
return -1;
}
if (atomicio(read, fd, p, msg_len) != msg_len) {
- error("ssh_msg_recv: read: %s", strerror(errno));
+ error("%s: read: %s", __func__, strerror(errno));
return (-1);
}
return (0);