$NetBSD: patch-aa,v 1.5 2008/08/24 10:04:49 dsainty Exp $

Let's assume that if the macro CMSG_FIRSTHDR is not defined, that struct
msghdr does not have the msg_control member, too. Needed for Solaris.

--- src/pty.c.orig	2007-02-26 22:05:14.000000000 +0100
+++ src/pty.c
@@ -659,12 +659,15 @@ _vte_pty_read_ptypair(int tunnel, int *p
 		msg.msg_namelen = 0;
 		msg.msg_iov = &vec;
 		msg.msg_iovlen = 1;
+#if defined(CMSG_FIRSTHDR)
 		msg.msg_control = control;
 		msg.msg_controllen = sizeof(control);
+#endif
 		ret = recvmsg(tunnel, &msg, PTY_RECVMSG_FLAGS);
 		if (ret == -1) {
 			return;
 		}
+#if defined(CMSG_FIRSTHDR)
 		for (cmsg = CMSG_FIRSTHDR(&msg);
 		     cmsg != NULL;
 		     cmsg = CMSG_NXTHDR(&msg, cmsg)) {
@@ -683,6 +686,7 @@ _vte_pty_read_ptypair(int tunnel, int *p
 				}
 			}
 		}
+#endif
 	}
 }
 #elif defined (I_RECVFD)
