Hi,
when running FastCGI apps under Perl in the background with fcgi/FCGI.pm
and you're using IPC::Open3, IPC::Run, IPC::Run3 or other code that
calls fileno() on a FCGI filehandle the application will die with:

Can't locate object method "FILENO" via package "FCGI::Stream" at
 /usr/local/libdata/perl5/site_perl/IPC/Run.pm line 1118.

Surprisingly, the FCGI.pm contains the function FILENO which is
commented out - the attached patch changes that and makes the named
IPC::* modules work under FastCGI.

Please test and comment.

Regards,
Simon

P.S.: additionally the other patches got regenerated


Index: Makefile
===================================================================
RCS file: /cvs/ports/www/fcgi/Makefile,v
retrieving revision 1.9
diff -u -p -r1.9 Makefile
--- Makefile    15 Sep 2007 20:38:21 -0000      1.9
+++ Makefile    23 May 2008 05:11:25 -0000
@@ -3,7 +3,7 @@
 COMMENT=               FastCGI Development Kit
 
 DISTNAME=              fcgi-2.4.0
-PKGNAME=               ${DISTNAME}p2
+PKGNAME=               ${DISTNAME}p3
 CATEGORIES=            www
 SHARED_LIBS += fcgi                 0.0      # .0.0
 SHARED_LIBS += fcgi++               1.0      # .1.0
Index: patches/patch-libfcgi_Makefile_in
===================================================================
RCS file: /cvs/ports/www/fcgi/patches/patch-libfcgi_Makefile_in,v
retrieving revision 1.1
diff -u -p -r1.1 patch-libfcgi_Makefile_in
--- patches/patch-libfcgi_Makefile_in   30 Dec 2005 22:27:40 -0000      1.1
+++ patches/patch-libfcgi_Makefile_in   23 May 2008 05:11:25 -0000
@@ -1,7 +1,7 @@
 $OpenBSD: patch-libfcgi_Makefile_in,v 1.1 2005/12/30 22:27:40 sturm Exp $
---- libfcgi/Makefile.in.orig   Fri Dec 30 23:20:04 2005
-+++ libfcgi/Makefile.in        Fri Dec 30 23:20:29 2005
-@@ -115,7 +115,7 @@ libfcgi___la_SOURCES = $(INCLUDE_FILES) 
+--- libfcgi/Makefile.in.orig   Sun Jan 19 18:21:18 2003
++++ libfcgi/Makefile.in        Fri May 23 07:12:26 2008
+@@ -115,7 +115,7 @@ libfcgi___la_SOURCES = $(INCLUDE_FILES)       \
                         fcgio.cpp
  
  libfcgi___la_CFLAGS = @PTHREAD_CFLAGS@
Index: patches/patch-libfcgi_os_unix_c
===================================================================
RCS file: /cvs/ports/www/fcgi/patches/patch-libfcgi_os_unix_c,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 patch-libfcgi_os_unix_c
--- patches/patch-libfcgi_os_unix_c     11 Feb 2004 20:13:35 -0000      1.1.1.1
+++ patches/patch-libfcgi_os_unix_c     23 May 2008 05:11:25 -0000
@@ -1,7 +1,7 @@
 $OpenBSD: patch-libfcgi_os_unix_c,v 1.1.1.1 2004/02/11 20:13:35 sturm Exp $
---- libfcgi/os_unix.c.orig     2004-02-11 20:40:53.000000000 +0100
-+++ libfcgi/os_unix.c  2004-02-11 20:41:05.000000000 +0100
-@@ -536,7 +536,7 @@ int OS_SpawnChild(char *appPath, int lis
+--- libfcgi/os_unix.c.orig     Tue Mar  5 20:14:49 2002
++++ libfcgi/os_unix.c  Fri May 23 07:12:26 2008
+@@ -536,7 +536,7 @@ int OS_SpawnChild(char *appPath, int listenFd)
           *
           * XXX: entire environment passes through
         */
Index: patches/patch-perl_FCGI_PL
===================================================================
RCS file: patches/patch-perl_FCGI_PL
diff -N patches/patch-perl_FCGI_PL
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-perl_FCGI_PL  23 May 2008 05:11:25 -0000
@@ -0,0 +1,12 @@
+$OpenBSD$
+--- perl/FCGI.PL.orig  Fri May 23 07:12:42 2008
++++ perl/FCGI.PL       Fri May 23 07:13:06 2008
+@@ -393,7 +393,7 @@ sub OPEN {
+ # Apparently some use fileno to determine if a filehandle is open,
+ # so we might want to return a defined, but meaningless value.
+ # An alternative would be to return the fcgi stream fd.
+-# sub FILENO { -2 }
++sub FILENO { -2 }
+ 
+ 1;
+ 

Reply via email to