summaryrefslogtreecommitdiff
path: root/monitor_fdpass.c
diff options
context:
space:
mode:
authorTim Rice <tim@multitalents.net>2002-05-27 17:37:32 -0700
committerTim Rice <tim@multitalents.net>2002-05-27 17:37:32 -0700
commit28bbb0c458c1f6cee5c3de1cec1f9dfea14d7196 (patch)
treed3363c5647504f6dfeb541f9d71ceac504247aef /monitor_fdpass.c
parent116e6dfaad3543c381ef48e0c42a3a86cebe644c (diff)
[configure.ac.orig monitor_fdpass.c] Enahnce msghdr tests to address
build problem on Irix reported by Dave Love <d.love@dl.ac.uk>. Back out last monitor_fdpass.c changes that are no longer needed with new tests. Patch tested on Irix by Jan-Frode Myklebust <janfrode@parallab.uib.no>
Diffstat (limited to 'monitor_fdpass.c')
-rw-r--r--monitor_fdpass.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/monitor_fdpass.c b/monitor_fdpass.c
index fb97171ff..5401ea466 100644
--- a/monitor_fdpass.c
+++ b/monitor_fdpass.c
@@ -39,14 +39,13 @@ mm_send_fd(int socket, int fd)
39 struct iovec vec; 39 struct iovec vec;
40 char ch = '\0'; 40 char ch = '\0';
41 int n; 41 int n;
42#if !defined(HAVE_ACCRIGHTS_IN_MSGHDR) || \ 42#ifndef HAVE_ACCRIGHTS_IN_MSGHDR
43 (defined(HAVE_ACCRIGHTS_IN_MSGHDR) && defined(HAVE_CONTROL_IN_MSGHDR))
44 char tmp[CMSG_SPACE(sizeof(int))]; 43 char tmp[CMSG_SPACE(sizeof(int))];
45 struct cmsghdr *cmsg; 44 struct cmsghdr *cmsg;
46#endif 45#endif
47 46
48 memset(&msg, 0, sizeof(msg)); 47 memset(&msg, 0, sizeof(msg));
49#if defined(HAVE_ACCRIGHTS_IN_MSGHDR) && !defined(HAVE_CONTROL_IN_MSGHDR) 48#ifdef HAVE_ACCRIGHTS_IN_MSGHDR
50 msg.msg_accrights = (caddr_t)&fd; 49 msg.msg_accrights = (caddr_t)&fd;
51 msg.msg_accrightslen = sizeof(fd); 50 msg.msg_accrightslen = sizeof(fd);
52#else 51#else
@@ -84,8 +83,7 @@ mm_receive_fd(int socket)
84 struct iovec vec; 83 struct iovec vec;
85 char ch; 84 char ch;
86 int fd, n; 85 int fd, n;
87#if !defined(HAVE_ACCRIGHTS_IN_MSGHDR) || \ 86#ifndef HAVE_ACCRIGHTS_IN_MSGHDR
88 (defined(HAVE_ACCRIGHTS_IN_MSGHDR) && defined(HAVE_CONTROL_IN_MSGHDR))
89 char tmp[CMSG_SPACE(sizeof(int))]; 87 char tmp[CMSG_SPACE(sizeof(int))];
90 struct cmsghdr *cmsg; 88 struct cmsghdr *cmsg;
91#endif 89#endif
@@ -95,7 +93,7 @@ mm_receive_fd(int socket)
95 vec.iov_len = 1; 93 vec.iov_len = 1;
96 msg.msg_iov = &vec; 94 msg.msg_iov = &vec;
97 msg.msg_iovlen = 1; 95 msg.msg_iovlen = 1;
98#if defined(HAVE_ACCRIGHTS_IN_MSGHDR) && !defined(HAVE_CONTROL_IN_MSGHDR) 96#ifdef HAVE_ACCRIGHTS_IN_MSGHDR
99 msg.msg_accrights = (caddr_t)&fd; 97 msg.msg_accrights = (caddr_t)&fd;
100 msg.msg_accrightslen = sizeof(fd); 98 msg.msg_accrightslen = sizeof(fd);
101#else 99#else
@@ -109,7 +107,7 @@ mm_receive_fd(int socket)
109 fatal("%s: recvmsg: expected received 1 got %d", 107 fatal("%s: recvmsg: expected received 1 got %d",
110 __FUNCTION__, n); 108 __FUNCTION__, n);
111 109
112#if defined(HAVE_ACCRIGHTS_IN_MSGHDR) && !defined(HAVE_CONTROL_IN_MSGHDR) 110#ifdef HAVE_ACCRIGHTS_IN_MSGHDR
113 if (msg.msg_accrightslen != sizeof(fd)) 111 if (msg.msg_accrightslen != sizeof(fd))
114 fatal("%s: no fd", __FUNCTION__); 112 fatal("%s: no fd", __FUNCTION__);
115#else 113#else