FreeBSD Bugzilla – Attachment 70832 Details for
Bug 103282
patch devel/p5-PPerl for amd64
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 3.99 KB, created by
Vick Khera
on 2006-09-14 20:50:19 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Vick Khera
Created:
2006-09-14 20:50:19 UTC
Size:
3.99 KB
patch
obsolete
>diff -Nru ./Makefile.PL ./Makefile.PL >--- ./Makefile.PL Thu Jul 11 11:11:50 2002 >+++ ./Makefile.PL Thu Sep 14 11:48:23 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 -Nru ./main.c ./main.c >--- ./main.c Tue Mar 2 12:06:15 2004 >+++ ./main.c Thu Sep 14 11:42:42 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]; > >diff -Nru ./pass_fd.c ./pass_fd.c >--- ./pass_fd.c Thu Aug 22 04:37:09 2002 >+++ ./pass_fd.c Thu Sep 14 11:36:05 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
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 103282
: 70832
Working