]> andersk Git - gssapi-openssh.git/commitdiff
OpenSSH 3.2.3p1 patch for Irix compile problem OPENSSH_3_2_3P1_MSGHDR_FIX
authorjbasney <jbasney>
Wed, 19 Jun 2002 13:18:55 +0000 (13:18 +0000)
committerjbasney <jbasney>
Wed, 19 Jun 2002 13:18:55 +0000 (13:18 +0000)
openssh/configure.ac
openssh/monitor_fdpass.c

index 63da575a962017cb4ceb4815d5d1ef03d30a149b..060173ea4f63c223ca6ab19f8d0685614de877c5 100644 (file)
@@ -1499,15 +1499,23 @@ if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
        AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
 fi
 
+dnl make sure we're using the real structure members and not defines
 AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
                ac_cv_have_accrights_in_msghdr, [
-       AC_TRY_COMPILE(
+       AC_TRY_RUN(
                [
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/uio.h>
+int main() {
+#ifdef msg_accrights
+exit(1);
+#endif
+struct msghdr m;
+m.msg_accrights = 0;
+exit(0);
+}
                ],
-               [ struct msghdr m; m.msg_accrights = 0; ],
                [ ac_cv_have_accrights_in_msghdr="yes" ],
                [ ac_cv_have_accrights_in_msghdr="no" ]
        )
@@ -1518,13 +1526,20 @@ fi
 
 AC_CACHE_CHECK([for msg_control field in struct msghdr],
                ac_cv_have_control_in_msghdr, [
-       AC_TRY_COMPILE(
+       AC_TRY_RUN(
                [
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/uio.h>
+int main() {
+#ifdef msg_control
+exit(1);
+#endif
+struct msghdr m;
+m.msg_control = 0;
+exit(0);
+}
                ],
-               [ struct msghdr m; m.msg_control = 0; ],
                [ ac_cv_have_control_in_msghdr="yes" ],
                [ ac_cv_have_control_in_msghdr="no" ]
        )
index fb97171ff5f5647d2478d0c5daf20dcaa5bf5a32..5401ea46656fce06a10c0ca45eb0bd982c1666ec 100644 (file)
@@ -39,14 +39,13 @@ mm_send_fd(int socket, int fd)
        struct iovec vec;
        char ch = '\0';
        int n;
-#if !defined(HAVE_ACCRIGHTS_IN_MSGHDR) || \
-       (defined(HAVE_ACCRIGHTS_IN_MSGHDR) && defined(HAVE_CONTROL_IN_MSGHDR))
+#ifndef HAVE_ACCRIGHTS_IN_MSGHDR
        char tmp[CMSG_SPACE(sizeof(int))];
        struct cmsghdr *cmsg;
 #endif
 
        memset(&msg, 0, sizeof(msg));
-#if defined(HAVE_ACCRIGHTS_IN_MSGHDR) && !defined(HAVE_CONTROL_IN_MSGHDR)
+#ifdef HAVE_ACCRIGHTS_IN_MSGHDR
        msg.msg_accrights = (caddr_t)&fd;
        msg.msg_accrightslen = sizeof(fd);
 #else
@@ -84,8 +83,7 @@ mm_receive_fd(int socket)
        struct iovec vec;
        char ch;
        int fd, n;
-#if !defined(HAVE_ACCRIGHTS_IN_MSGHDR) || \
-       (defined(HAVE_ACCRIGHTS_IN_MSGHDR) && defined(HAVE_CONTROL_IN_MSGHDR))
+#ifndef HAVE_ACCRIGHTS_IN_MSGHDR
        char tmp[CMSG_SPACE(sizeof(int))];
        struct cmsghdr *cmsg;
 #endif
@@ -95,7 +93,7 @@ mm_receive_fd(int socket)
        vec.iov_len = 1;
        msg.msg_iov = &vec;
        msg.msg_iovlen = 1;
-#if defined(HAVE_ACCRIGHTS_IN_MSGHDR) && !defined(HAVE_CONTROL_IN_MSGHDR)
+#ifdef HAVE_ACCRIGHTS_IN_MSGHDR
        msg.msg_accrights = (caddr_t)&fd;
        msg.msg_accrightslen = sizeof(fd);
 #else
@@ -109,7 +107,7 @@ mm_receive_fd(int socket)
                fatal("%s: recvmsg: expected received 1 got %d",
                    __FUNCTION__, n);
 
-#if defined(HAVE_ACCRIGHTS_IN_MSGHDR) && !defined(HAVE_CONTROL_IN_MSGHDR)
+#ifdef HAVE_ACCRIGHTS_IN_MSGHDR
        if (msg.msg_accrightslen != sizeof(fd))
                fatal("%s: no fd", __FUNCTION__);
 #else
This page took 0.249551 seconds and 5 git commands to generate.