summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2002-06-26 14:50:05 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2002-06-26 14:50:05 +0000
commitbfe5665cb64932da31c49e79b152d089e35c8367 (patch)
treed2489e3babd46c9b1d96d70cb98c98aeec706aed /usr.bin
parentf6947066bc0c633e230430c7d6a40430054b9415 (diff)
use ssize_t for recvmsg() and sendmsg() return
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/ssh/monitor_fdpass.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/usr.bin/ssh/monitor_fdpass.c b/usr.bin/ssh/monitor_fdpass.c
index 9696c869e79..fd09e88f61e 100644
--- a/usr.bin/ssh/monitor_fdpass.c
+++ b/usr.bin/ssh/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 <sys/uio.h>
@@ -39,7 +39,7 @@ mm_send_fd(int socket, int fd)
struct cmsghdr *cmsg;
struct iovec vec;
char ch = '\0';
- int n;
+ ssize_t n;
memset(&msg, 0, sizeof(msg));
msg.msg_control = (caddr_t)tmp;
@@ -59,8 +59,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);
}
int
@@ -70,8 +70,9 @@ mm_receive_fd(int socket)
char tmp[CMSG_SPACE(sizeof(int))];
struct cmsghdr *cmsg;
struct iovec vec;
+ ssize_t n;
char ch;
- int fd, n;
+ int fd;
memset(&msg, 0, sizeof(msg));
vec.iov_base = &ch;
@@ -84,8 +85,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);
cmsg = CMSG_FIRSTHDR(&msg);
if (cmsg->cmsg_type != SCM_RIGHTS)