From d5bf46e4c08f09fdac235ab7f9066949dd8e1496 Mon Sep 17 00:00:00 2001 From: Ben Lindstrom Date: Thu, 27 Jun 2002 00:21:03 +0000 Subject: [PATCH] - deraadt@cvs.openbsd.org 2002/06/26 14:50:04 [monitor_fdpass.c] use ssize_t for recvmsg() and sendmsg() return --- ChangeLog | 5 ++++- monitor_fdpass.c | 15 ++++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 83a88d48c..8f015ac6e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,9 @@ - deraadt@cvs.openbsd.org 2002/06/26 14:49:36 [monitor.c] correct %u + - deraadt@cvs.openbsd.org 2002/06/26 14:50:04 + [monitor_fdpass.c] + use ssize_t for recvmsg() and sendmsg() return 20020626 - (stevesk) [monitor.c] remove duplicate proto15 dispatch entry for PAM @@ -1175,4 +1178,4 @@ - (stevesk) entropy.c: typo in debug message - (djm) ssh-keygen -i needs seeded RNG; report from markus@ -$Id: ChangeLog,v 1.2303 2002/06/27 00:12:57 mouring Exp $ +$Id: ChangeLog,v 1.2304 2002/06/27 00:21:03 mouring Exp $ diff --git a/monitor_fdpass.c b/monitor_fdpass.c index 0d7628fa2..641ce721e 100644 --- a/monitor_fdpass.c +++ b/monitor_fdpass.c @@ -24,7 +24,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: monitor_fdpass.c,v 1.3 2002/06/04 23:05:49 markus Exp $"); +RCSID("$OpenBSD: monitor_fdpass.c,v 1.4 2002/06/26 14:50:04 deraadt Exp $"); #include @@ -38,7 +38,7 @@ mm_send_fd(int socket, int fd) struct msghdr msg; struct iovec vec; char ch = '\0'; - int n; + ssize_t n; #ifndef HAVE_ACCRIGHTS_IN_MSGHDR char tmp[CMSG_SPACE(sizeof(int))]; struct cmsghdr *cmsg; @@ -67,8 +67,8 @@ mm_send_fd(int socket, int fd) fatal("%s: sendmsg(%d): %s", __func__, fd, strerror(errno)); if (n != 1) - fatal("%s: sendmsg: expected sent 1 got %d", - __func__, n); + fatal("%s: sendmsg: expected sent 1 got %ld", + __func__, (long)n); #else fatal("%s: UsePrivilegeSeparation=yes not supported", __func__); @@ -81,8 +81,9 @@ mm_receive_fd(int socket) #if defined(HAVE_RECVMSG) && (defined(HAVE_ACCRIGHTS_IN_MSGHDR) || defined(HAVE_CONTROL_IN_MSGHDR)) struct msghdr msg; struct iovec vec; + ssize_t n; char ch; - int fd, n; + int fd; #ifndef HAVE_ACCRIGHTS_IN_MSGHDR char tmp[CMSG_SPACE(sizeof(int))]; struct cmsghdr *cmsg; @@ -104,8 +105,8 @@ mm_receive_fd(int socket) if ((n = recvmsg(socket, &msg, 0)) == -1) fatal("%s: recvmsg: %s", __func__, strerror(errno)); if (n != 1) - fatal("%s: recvmsg: expected received 1 got %d", - __func__, n); + fatal("%s: recvmsg: expected received 1 got %ld", + __func__, (long)n); #ifdef HAVE_ACCRIGHTS_IN_MSGHDR if (msg.msg_accrightslen != sizeof(fd))