diff options
author | Eric Wong <e@80x24.org> | 2024-01-09 11:39:28 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2024-01-10 10:27:03 +0000 |
commit | 57b691c79fa97118e963043a0cd1530ec8ddf916 (patch) | |
tree | b127b9abee0e5af5d712e8293ea925e3ec39f7fb /lib/PublicInbox/WwwCoderepo.pm | |
parent | 61c44bbd8e57c719a1a4de75a1a11c412173e820 (diff) | |
download | public-inbox-57b691c79fa97118e963043a0cd1530ec8ddf916.tar.gz |
This cuts down on code somewhat (before I add more :x)
Diffstat (limited to 'lib/PublicInbox/WwwCoderepo.pm')
-rw-r--r-- | lib/PublicInbox/WwwCoderepo.pm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/PublicInbox/WwwCoderepo.pm b/lib/PublicInbox/WwwCoderepo.pm index 3814f719..4ab9a77c 100644 --- a/lib/PublicInbox/WwwCoderepo.pm +++ b/lib/PublicInbox/WwwCoderepo.pm @@ -23,6 +23,7 @@ use PublicInbox::RepoList; use PublicInbox::OnDestroy; use URI::Escape qw(uri_escape_utf8); use File::Spec; +use autodie qw(fcntl open); my @EACH_REF = (qw(git for-each-ref --sort=-creatordate), "--format=%(HEAD)%00".join('%00', map { "%($_)" } @@ -81,11 +82,11 @@ sub new { $self->{$_} = 10 for qw(summary_log); # try reuse STDIN if it's already /dev/null - open $self->{log_fh}, '+>', '/dev/null' or die "open: $!"; + open $self->{log_fh}, '+>', '/dev/null'; my @l = stat($self->{log_fh}) or die "stat: $!"; my @s = stat(STDIN) or die "stat(STDIN): $!"; if ("@l[0, 1]" eq "@s[0, 1]") { - my $f = fcntl(STDIN, F_GETFL, 0) // die "F_GETFL: $!"; + my $f = fcntl(STDIN, F_GETFL, 0); $self->{log_fh} = *STDIN{IO} if $f & O_RDWR; } $self; |