public-inbox.git  about / heads / tags
an "archives first" approach to mailing lists
blob d4792b2518475e4ae21a868f773668fbdb61cd97 517 bytes (raw)
$ git show HEAD:lib/PublicInbox/LI2Wrap.pm	# shows this blob on the CLI

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
 
# Copyright (C) all contributors <meta@public-inbox.org>
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>

# Wrapper for Linux::Inotify2 < 2.3 which lacked ->fh and auto-close
# Remove this when supported LTS/enterprise distros are all
# Linux::Inotify2 >= 2.3
package PublicInbox::LI2Wrap;
use v5.12;
our @ISA = qw(Linux::Inotify2);

sub wrapclose {
	my ($inot) = @_;
	my $fd = $inot->fileno;
	open my $fh, '<&=', $fd or die "open <&= $fd $!";
	bless $inot, __PACKAGE__;
}

sub DESTROY {} # no-op

1

git clone https://public-inbox.org/public-inbox.git
git clone http://7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/public-inbox.git