about summary refs log tree commit homepage
path: root/examples
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-05-21 10:28:25 +0000
committerEric Wong <e@80x24.org>2021-05-23 01:33:01 +0000
commite901a56b3b30b22f16bc9c6460150b2b402b4ee7 (patch)
tree72e971f85d251bcbb0a92c9a956ec153652f7f2f /examples
parent3c1d0da4d0608b5a87371e602a911964d7c1498c (diff)
downloadpublic-inbox-e901a56b3b30b22f16bc9c6460150b2b402b4ee7.tar.gz
treewide: favor open(..., '+<&=', $fd)
Cut down on unnecessary imports of IO::Handle and
method lookup + dispatch overhead.
Diffstat (limited to 'examples')
-rw-r--r--examples/unsubscribe.milter3
1 files changed, 1 insertions, 2 deletions
diff --git a/examples/unsubscribe.milter b/examples/unsubscribe.milter
index 7b126e30..608524cb 100644
--- a/examples/unsubscribe.milter
+++ b/examples/unsubscribe.milter
@@ -2,7 +2,6 @@
 # Copyright (C) 2016-2021 all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 use strict;
-use warnings;
 use Sendmail::PMilter qw(:all);
 use IO::Socket;
 use Crypt::CBC;
@@ -128,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;
-        my $s = IO::Socket->new_from_fd($start_fd, 'r') or
+        open(my $s, '<&=', $start_fd) or
                 die "inherited bad FD from LISTEN_FDS: $!\n";
         $milter->set_socket($s);
 } else {