diff options
author | mycroft <mycroft@pkgsrc.org> | 2000-11-11 02:07:57 +0000 |
---|---|---|
committer | mycroft <mycroft@pkgsrc.org> | 2000-11-11 02:07:57 +0000 |
commit | b525469aae8ce4bbac1c9f33ab6413c0a3657a3b (patch) | |
tree | f19e3e6b794a1eebeaf4862be3b3aa5752336f9a /x11 | |
parent | 489fdc67e42cae6897752d990239a5aa94478313 (diff) | |
download | pkgsrc-b525469aae8ce4bbac1c9f33ab6413c0a3657a3b.tar.gz |
Fix file descriptor passing in zvt, as per regress/sys/kern/unfdpass.
This makes gnome-terminal actually work on PowerPC...
Diffstat (limited to 'x11')
-rw-r--r-- | x11/gnome-libs/files/patch-sum | 4 | ||||
-rw-r--r-- | x11/gnome-libs/patches/patch-ap | 55 | ||||
-rw-r--r-- | x11/gnome-libs/patches/patch-aq | 54 |
3 files changed, 112 insertions, 1 deletions
diff --git a/x11/gnome-libs/files/patch-sum b/x11/gnome-libs/files/patch-sum index 75e7d3ce805..7c02ef639e5 100644 --- a/x11/gnome-libs/files/patch-sum +++ b/x11/gnome-libs/files/patch-sum @@ -1,4 +1,4 @@ -$NetBSD: patch-sum,v 1.16 2000/10/17 23:57:45 jlam Exp $ +$NetBSD: patch-sum,v 1.17 2000/11/11 02:07:57 mycroft Exp $ MD5 (patch-aa) = 304237d9a4a0fbfadd79537c0f67926e MD5 (patch-ac) = 503fba99ca4f3eb7273a438068694436 @@ -10,3 +10,5 @@ MD5 (patch-ak) = aef962961191617c236950a2e60a289b MD5 (patch-al) = 88791beef747b37ab7ac78a8705637c1 MD5 (patch-an) = f04a6f1ed6b81360a964c60152d8b0e4 MD5 (patch-ao) = 443ab84138c1d1c8c997a684101baff5 +MD5 (patch-ap) = c37e3352b6848fb0a325298bc8b3be10 +MD5 (patch-aq) = 415545b5019078778745266108d93ba1 diff --git a/x11/gnome-libs/patches/patch-ap b/x11/gnome-libs/patches/patch-ap new file mode 100644 index 00000000000..58604dafdaa --- /dev/null +++ b/x11/gnome-libs/patches/patch-ap @@ -0,0 +1,55 @@ +$NetBSD: patch-ap,v 1.1 2000/11/11 02:07:57 mycroft Exp $ + +--- zvt/subshell.c.orig Sat Nov 11 01:59:48 2000 ++++ zvt/subshell.c Sat Nov 11 01:59:11 2000 +@@ -101,32 +101,43 @@ + #endif + #endif /* CMSG_DATA */ + +-static struct cmsghdr *cmptr; +-#define CONTROLLEN sizeof (struct cmsghdr) + sizeof (int) ++#define FD_LEN (sizeof(int) * 1) ++ ++static void *cmptr; + + static int + receive_fd (int helper_fd) + { + struct iovec iov [1]; + struct msghdr msg; ++ struct cmsghdr *cmp; + char buf [32]; + ++ if (cmptr == NULL && (cmptr = g_malloc (CMSG_SPACE(FD_LEN))) == NULL) ++ return -1; ++ + iov [0].iov_base = buf; + iov [0].iov_len = sizeof (buf); ++ ++ memset(&msg, 0, sizeof(msg)); + msg.msg_iov = iov; + msg.msg_iovlen = 1; + msg.msg_name = NULL; + msg.msg_namelen = 0; +- +- if (cmptr == NULL && (cmptr = g_malloc (CONTROLLEN)) == NULL) +- return -1; + msg.msg_control = (caddr_t) cmptr; +- msg.msg_controllen = CONTROLLEN; ++ msg.msg_controllen = CMSG_LEN(FD_LEN); + ++ memset(cmptr, 0, CMSG_SPACE(FD_LEN)); + if (recvmsg (helper_fd, &msg, 0) <= 0) + return -1; + +- return *(int *) CMSG_DATA (cmptr); ++ for (cmp = CMSG_FIRSTHDR(&msg); cmp != NULL; ++ cmp = CMSG_NXTHDR(&msg, cmp)) { ++ if (cmp->cmsg_type == SCM_RIGHTS) ++ return *(int *) CMSG_DATA (cmp); ++ } ++ ++ return -1; + } + + static int diff --git a/x11/gnome-libs/patches/patch-aq b/x11/gnome-libs/patches/patch-aq new file mode 100644 index 00000000000..f5c459e64fb --- /dev/null +++ b/x11/gnome-libs/patches/patch-aq @@ -0,0 +1,54 @@ +$NetBSD: patch-aq,v 1.1 2000/11/11 02:07:57 mycroft Exp $ + +--- zvt/gnome-pty-helper.c.orig Sat Mar 18 07:57:13 2000 ++++ zvt/gnome-pty-helper.c Sat Nov 11 01:59:16 2000 +@@ -115,14 +115,14 @@ + #endif + #endif /* CMSG_DATA */ + +-#define CONTROLLEN (sizeof (struct cmsghdr) + sizeof (int)) ++#define FD_LEN (sizeof(int) * 1) + +-static struct cmsghdr *cmptr; ++static void *cmptr; + + static int + init_msg_pass () + { +- cmptr = malloc (CONTROLLEN); ++ cmptr = malloc (CMSG_SPACE(FD_LEN)); + + if (cmptr) + return 0; +@@ -135,22 +135,26 @@ + { + struct iovec iov[1]; + struct msghdr msg; ++ struct cmsghdr *cmp; + char buf [1]; + + iov [0].iov_base = buf; + iov [0].iov_len = 1; + ++ memset(&msg, 0, sizeof(msg)); + msg.msg_iov = iov; + msg.msg_iovlen = 1; + msg.msg_name = NULL; + msg.msg_namelen = 0; + msg.msg_control = (caddr_t) cmptr; +- msg.msg_controllen = CONTROLLEN; ++ msg.msg_controllen = CMSG_LEN(FD_LEN); + +- cmptr->cmsg_level = SOL_SOCKET; +- cmptr->cmsg_type = SCM_RIGHTS; +- cmptr->cmsg_len = CONTROLLEN; +- *(int *)CMSG_DATA (cmptr) = fd; ++ memset(cmptr, 0, CMSG_SPACE(FD_LEN)); ++ cmp = CMSG_FIRSTHDR(&msg); ++ cmp->cmsg_level = SOL_SOCKET; ++ cmp->cmsg_type = SCM_RIGHTS; ++ cmp->cmsg_len = CMSG_LEN(FD_LEN); ++ *(int *)CMSG_DATA (cmp) = fd; + + if (sendmsg (client_fd, &msg, 0) != 1) + return -1; |