]> Sergey Matveev's repositories - public-inbox.git/blobdiff - examples/unsubscribe.milter
treewide: favor open(..., '+<&=', $fd)
[public-inbox.git] / examples / unsubscribe.milter
index 7b126e3094e4f0e2b46aebc81bae952d8dadfaec..608524cbaca40337a8ca45a1f0b7d0ba38cfd774 100644 (file)
@@ -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 {