$NetBSD: patch-aa,v 1.4 2007/04/11 22:40:14 wiz 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
@@ -1,3 +1,4 @@
+#include <sys/types.h>
 /*
  * Copyright (C) 2001,2002 Red Hat, Inc.
  *
@@ -659,12 +660,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 +687,7 @@ _vte_pty_read_ptypair(int tunnel, int *p
 				}
 			}
 		}
+#endif
 	}
 }
 #elif defined (I_RECVFD)
