diff options
author | rafan <rafan@FreeBSD.org> | 2006-09-18 21:18:55 +0800 |
---|---|---|
committer | rafan <rafan@FreeBSD.org> | 2006-09-18 21:18:55 +0800 |
commit | c5c9b472b1870aea96e32d4cc506bb003dd3cf9e (patch) | |
tree | cbae48ba3e52cc193fe21221d96eb133456eb049 /devel | |
parent | 22440dfa149e7f615a254ef20580627d3ba627dc (diff) | |
download | freebsd-ports-gnome-c5c9b472b1870aea96e32d4cc506bb003dd3cf9e.tar.gz freebsd-ports-gnome-c5c9b472b1870aea96e32d4cc506bb003dd3cf9e.tar.zst freebsd-ports-gnome-c5c9b472b1870aea96e32d4cc506bb003dd3cf9e.zip |
- Fix test on amd64
Note that it still fails due to the multiuser patch. However, I think
this PR already improves PPerl on amd64 a lot. So, I decide to commit
it first.
- Correct CFLAGS passed to cc (patch-Makefile.PL)
These patches were sent to the author via CPAN RT.
PR: ports/103282
Submitted by: Vivek Khera <vivek at khera.org>
Diffstat (limited to 'devel')
-rw-r--r-- | devel/p5-PPerl/Makefile | 2 | ||||
-rw-r--r-- | devel/p5-PPerl/files/patch-Makefile.PL | 11 | ||||
-rw-r--r-- | devel/p5-PPerl/files/patch-main.c | 19 | ||||
-rw-r--r-- | devel/p5-PPerl/files/patch-pass_fd.c | 128 |
4 files changed, 157 insertions, 3 deletions
diff --git a/devel/p5-PPerl/Makefile b/devel/p5-PPerl/Makefile index 424ab038fac4..f0472730e863 100644 --- a/devel/p5-PPerl/Makefile +++ b/devel/p5-PPerl/Makefile @@ -8,7 +8,7 @@ PORTNAME= PPerl PORTVERSION= 0.25 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= devel perl5 MASTER_SITES= ${MASTER_SITE_PERL_CPAN} MASTER_SITE_SUBDIR= ../../authors/id/M/MS/MSERGEANT diff --git a/devel/p5-PPerl/files/patch-Makefile.PL b/devel/p5-PPerl/files/patch-Makefile.PL new file mode 100644 index 000000000000..b6fadece94b1 --- /dev/null +++ b/devel/p5-PPerl/files/patch-Makefile.PL @@ -0,0 +1,11 @@ +--- Makefile.PL.orig Fri Sep 15 21:59:08 2006 ++++ Makefile.PL Fri Sep 15 21:59:24 2006 +@@ -69,7 +69,7 @@ + main.o: Makefile main.c pperl.h + + pperl: main.o pass_fd.o +-\t\$(CC) \$(CFLAGS) \$(LDFLAGS) \$(DEFINE) -o pperl main.o pass_fd.o $Config{libs} ++\t\$(CC) \$(CCFLAGS) \$(OPTIMIZE) \$(LDFLAGS) \$(DEFINE) -o pperl main.o pass_fd.o $Config{libs} + + pass_fd.c: pass_fd.h + diff --git a/devel/p5-PPerl/files/patch-main.c b/devel/p5-PPerl/files/patch-main.c index 79795b564c62..5594d559df21 100644 --- a/devel/p5-PPerl/files/patch-main.c +++ b/devel/p5-PPerl/files/patch-main.c @@ -1,10 +1,25 @@ --- main.c.orig Wed Mar 3 01:06:15 2004 -+++ main.c Mon Dec 13 18:22:53 2004 ++++ main.c Fri Sep 15 16:48:22 2006 +@@ -105,11 +105,11 @@ + newval = atoi(pArg); + if (newval > 0) prefork = newval; + } +- else if (!strncmp(pArg, "--logfile", 7) ) { ++ else if (!strncmp(pArg, "--logfile", 9) ) { + int newval; + char *filename; +- if (pArg[7] == '=') /* --logfile=.... */ +- pArg += 13; ++ if (pArg[9] == '=') /* --logfile=.... */ ++ pArg += 10; + else + pArg = argv[++i]; + @@ -223,6 +223,8 @@ /* strict C compilers can't/won't do char foo[variant]; */ char *fullpath = my_malloc(path_max); int i = 0; -+ char euid[sizeof(uid_t)+2]; ++ char euid[sizeof(uid_t)+10+2]; + sprintf(euid, "_%d", geteuid()); if (realpath(scriptname, fullpath) == NULL) { diff --git a/devel/p5-PPerl/files/patch-pass_fd.c b/devel/p5-PPerl/files/patch-pass_fd.c new file mode 100644 index 000000000000..9bf66f37871e --- /dev/null +++ b/devel/p5-PPerl/files/patch-pass_fd.c @@ -0,0 +1,128 @@ +--- pass_fd.c.orig Thu Aug 22 16:37:09 2002 ++++ pass_fd.c Fri Sep 15 16:48:22 2006 +@@ -93,73 +93,74 @@ + + #else + +-struct cmessage { +- struct cmsghdr cmsg; +- int fd; +-}; ++/* based on code from Postfix 2.3.3 (vk) */ ++ ++union { ++ struct cmsghdr just_for_alignment; ++ char control[CMSG_SPACE(sizeof(int))]; ++} control_un; + + int +-send_fd(int over, int this) ++send_fd(int over, int sendfd) + { +- struct iovec iov[1]; +- struct msghdr msg; +- struct cmessage cm; +- char sendbuf[] = ""; +- +- iov[0].iov_base = (char *)&sendbuf; +- iov[0].iov_len = sizeof(sendbuf); +- +- cm.cmsg.cmsg_type = SCM_RIGHTS; +- cm.cmsg.cmsg_level = SOL_SOCKET; +- cm.cmsg.cmsg_len = sizeof(struct cmessage); +- cm.fd = this; +- +- msg.msg_iov = iov; +- msg.msg_iovlen = 1; +- msg.msg_name = NULL; +- msg.msg_namelen = 0; +- msg.msg_control = (caddr_t)&cm; +- msg.msg_controllen = sizeof(struct cmessage); +- msg.msg_flags = 0; +- +- if (sendmsg(over, &msg, 0) < 0) +- return -1; +- return 0; ++ struct iovec iov[1]; ++ struct msghdr msg; ++ struct cmsghdr *cmptr; ++ ++ memset((char *) &msg, 0, sizeof(msg)); ++ ++ msg.msg_control = control_un.control; ++ msg.msg_controllen = CMSG_LEN(sizeof(sendfd)); ++ ++ cmptr = CMSG_FIRSTHDR(&msg); ++ cmptr->cmsg_len = CMSG_LEN(sizeof(sendfd)); ++ cmptr->cmsg_level = SOL_SOCKET; ++ cmptr->cmsg_type = SCM_RIGHTS; ++ *(int *) CMSG_DATA(cmptr) = sendfd; ++ ++ msg.msg_name = NULL; ++ msg.msg_namelen = 0; ++ ++ iov[0].iov_base = ""; ++ iov[0].iov_len = 1; ++ msg.msg_iov = iov; ++ msg.msg_iovlen = 1; ++ ++ if (sendmsg(over, &msg, 0) < 0) ++ return -1; ++ return 0; + } + + int + recv_fd(int over) + { +- struct iovec iov[1]; + struct msghdr msg; +- struct cmessage cm; +- ssize_t got; +- char recbuf; +- +- /* in examples this was >1 but this causes too much to be read, +- * causing sync issues */ ++ struct iovec iov[1]; ++ char buf[1]; ++ struct cmsghdr *cmptr; + +- iov[0].iov_base = &recbuf; +- iov[0].iov_len = 1; ++ memset((char *) &msg, 0, sizeof(msg)); ++ msg.msg_control = control_un.control; ++ msg.msg_controllen = CMSG_LEN(sizeof(int)); + +- bzero((char *)&cm, sizeof(cm)); +- bzero((char *)&msg, sizeof(msg)); ++ msg.msg_name = 0; ++ msg.msg_namelen = 0; + ++ iov[0].iov_base = buf; ++ iov[0].iov_len = sizeof(buf); + msg.msg_iov = iov; + msg.msg_iovlen = 1; +- msg.msg_name = NULL; +- msg.msg_namelen = 0; +- msg.msg_control = (caddr_t)&cm; +- msg.msg_controllen = sizeof(struct cmessage); +- msg.msg_flags = 0; +- +- if ((got = recvmsg(over, &msg, 0)) < 0) +- return -1; + +- if (cm.cmsg.cmsg_type != SCM_RIGHTS) +- return -1; ++ if (recvmsg(over, &msg, 0) < 0) ++ return (-1); + +- return cm.fd; ++ if ((cmptr = CMSG_FIRSTHDR(&msg)) != 0 ++ && cmptr->cmsg_len == CMSG_LEN(sizeof(int))) { ++ if (cmptr->cmsg_level != SOL_SOCKET || cmptr->cmsg_type != SCM_RIGHTS) ++ return(-1); /* error */ ++ return (*(int *) CMSG_DATA(cmptr)); /* the file handle */ ++ } else ++ return (-1); + } + + #endif |