$NetBSD: patch-aa,v 1.2 2006/07/13 23:36:18 rillig 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	2004-05-01 09:12:51.000000000 +0200
+++ src/pty.c	2006-07-14 01:17:28.073815601 +0200
@@ -1,3 +1,4 @@
+#include <sys/types.h>
 /*
  * Copyright (C) 2001,2002 Red Hat, Inc.
  *
@@ -837,12 +838,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)) {
@@ -861,6 +865,7 @@ _vte_pty_read_ptypair(int tunnel, int *p
 				}
 			}
 		}
+#endif
 	}
 }
 #else
