diff options
author | djm@openbsd.org <djm@openbsd.org> | 2020-10-18 11:32:01 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2020-10-18 23:46:29 +1100 |
commit | 816036f142ecd284c12bb3685ae316a68d2ef190 (patch) | |
tree | b964deff7f92305df67c23cc359859101798d629 /monitor_fdpass.c | |
parent | 9e2c4f64224f68fb84c49b5182e449f94b0dc985 (diff) |
upstream: use the new variant log macros instead of prepending
__func__ and appending ssh_err(r) manually; ok markus@
OpenBSD-Commit-ID: 1f14b80bcfa85414b2a1a6ff714fb5362687ace8
Diffstat (limited to 'monitor_fdpass.c')
-rw-r--r-- | monitor_fdpass.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/monitor_fdpass.c b/monitor_fdpass.c index d766edcf..a07727a8 100644 --- a/monitor_fdpass.c +++ b/monitor_fdpass.c @@ -1,4 +1,4 @@ -/* $OpenBSD: monitor_fdpass.c,v 1.21 2016/02/29 20:22:36 jca Exp $ */ +/* $OpenBSD: monitor_fdpass.c,v 1.22 2020/10/18 11:32:01 djm Exp $ */ /* * Copyright 2001 Niels Provos <provos@citi.umich.edu> * All rights reserved. @@ -89,17 +89,16 @@ mm_send_fd(int sock, int fd) pfd.events = POLLOUT; while ((n = sendmsg(sock, &msg, 0)) == -1 && (errno == EAGAIN || errno == EINTR)) { - debug3("%s: sendmsg(%d): %s", __func__, fd, strerror(errno)); + debug3_f("sendmsg(%d): %s", fd, strerror(errno)); (void)poll(&pfd, 1, -1); } if (n == -1) { - error("%s: sendmsg(%d): %s", __func__, fd, - strerror(errno)); + error_f("sendmsg(%d): %s", fd, strerror(errno)); return -1; } if (n != 1) { - error("%s: sendmsg: expected sent 1 got %zd", __func__, n); + error_f("sendmsg: expected sent 1 got %zd", n); return -1; } return 0; @@ -145,35 +144,34 @@ mm_receive_fd(int sock) pfd.events = POLLIN; while ((n = recvmsg(sock, &msg, 0)) == -1 && (errno == EAGAIN || errno == EINTR)) { - debug3("%s: recvmsg: %s", __func__, strerror(errno)); + debug3_f("recvmsg: %s", strerror(errno)); (void)poll(&pfd, 1, -1); } if (n == -1) { - error("%s: recvmsg: %s", __func__, strerror(errno)); + error_f("recvmsg: %s", strerror(errno)); return -1; } if (n != 1) { - error("%s: recvmsg: expected received 1 got %zd", __func__, n); + error_f("recvmsg: expected received 1 got %zd", n); return -1; } #ifdef HAVE_ACCRIGHTS_IN_MSGHDR if (msg.msg_accrightslen != sizeof(fd)) { - error("%s: no fd", __func__); + error_f("no fd"); return -1; } #else cmsg = CMSG_FIRSTHDR(&msg); if (cmsg == NULL) { - error("%s: no message header", __func__); + error_f("no message header"); return -1; } #ifndef BROKEN_CMSG_TYPE if (cmsg->cmsg_type != SCM_RIGHTS) { - error("%s: expected type %d got %d", __func__, - SCM_RIGHTS, cmsg->cmsg_type); + error_f("expected %d got %d", SCM_RIGHTS, cmsg->cmsg_type); return -1; } #endif @@ -181,7 +179,7 @@ mm_receive_fd(int sock) #endif return fd; #else - error("%s: file descriptor passing not supported", __func__); + error_f("file descriptor passing not supported"); return -1; #endif } |