unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
* [PATCH] examples/unsubscribe.milter: use IO::Socket, again
@ 2022-04-02  1:40 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2022-04-02  1:40 UTC (permalink / raw)
  To: meta

Sendmail::PMilter requires an IO::Socket object, not a GLOB.

Fixes: e901a56b3b30b22f (treewide: favor open(..., '+<&=', $fd), 2021-05-21)
---
 examples/unsubscribe.milter | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/unsubscribe.milter b/examples/unsubscribe.milter
index 608524cb..04a39761 100644
--- a/examples/unsubscribe.milter
+++ b/examples/unsubscribe.milter
@@ -127,7 +127,7 @@ my $fds = $ENV{LISTEN_FDS};
 if ($fds && (($ENV{LISTEN_PID} || 0) == $$)) {
 	die "$0 can only listen on one FD\n" if $fds != 1;
 	my $start_fd = 3;
-	open(my $s, '<&=', $start_fd) or
+	my $s = IO::Socket->new_from_fd($start_fd, 'r') or
 		die "inherited bad FD from LISTEN_FDS: $!\n";
 	$milter->set_socket($s);
 } else {

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-04-02  1:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-02  1:40 [PATCH] examples/unsubscribe.milter: use IO::Socket, again Eric Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).