Skip to content

Commit

Permalink
Add FILENO method to FCGI.pm to comply with IO:: interface
Browse files Browse the repository at this point in the history
FILENO method returns a defined but invalid value (can never be defined
as the error return from the syscall is -1) to placate things such as
IPC::Run which call fileno to check if a filehandle is open.

Closes bugs:
 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=544540
 http://rt.cpan.org/Public/Bug/Display.html?id=50972
 Removes need for upstream patch in OpenBSD
  • Loading branch information
bobtfish authored and mcarbonneaux committed Nov 4, 2024
1 parent b4e48a7 commit 6447e29
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
8 changes: 8 additions & 0 deletions perl/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
o Add FILENO method which returns a defined but invalid value to
placate things such as IPC::Run which call fileno to check if a
filehandle is open.
Closes bugs:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=544540
http://rt.cpan.org/Public/Bug/Display.html?id=50972
Removes need for upstream patch in OpenBSD

Version 0.68 -- 21 June 2003 <[email protected]> Sven Verdoolaege

o Call the fcgi lib's attach/detach <[email protected]>
Expand Down
9 changes: 5 additions & 4 deletions perl/FCGI.PL
Original file line number Diff line number Diff line change
Expand Up @@ -390,10 +390,11 @@ 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 }
# Some things (e.g. IPC::Run) use fileno to determine if a filehandle is open,
# so we return a defined, but meaningless value. (-1 being the error return
# value from the syscall in c, meaning it can never be a valid fd no)
# Probably a better alternative would be to return the fcgi stream fd.
sub FILENO { -1 }
1;
Expand Down

0 comments on commit 6447e29

Please sign in to comment.