From: Eric Wong Date: Fri, 16 Oct 2020 07:05:10 +0000 (+0000) Subject: tmpfile: modernize to 5.10.1+, note O_APPEND workaround X-Git-Tag: v1.7.0~1706 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=c51b6340a05cf11f7b0b3bb978288ade2f930c4a;p=public-inbox.git tmpfile: modernize to 5.10.1+, note O_APPEND workaround Once again we'll need O_APPEND on a temporary file, so note we support it, here; since Perl 5.32 is way too new to depend on our users having. --- diff --git a/lib/PublicInbox/Tmpfile.pm b/lib/PublicInbox/Tmpfile.pm index 25bb3a52..eb0fce00 100644 --- a/lib/PublicInbox/Tmpfile.pm +++ b/lib/PublicInbox/Tmpfile.pm @@ -2,8 +2,8 @@ # License: AGPL-3.0+ package PublicInbox::Tmpfile; use strict; -use warnings; -use base qw(Exporter); +use v5.10.1; +use parent qw(Exporter); our @EXPORT = qw(tmpfile); use Fcntl qw(:DEFAULT); use Errno qw(EEXIST); @@ -13,6 +13,9 @@ use File::Spec; # unlinked filename which makes sense when viewed with lsof # (at least on Linux) # And if we ever stop caring to have debuggable filenames, O_TMPFILE :) +# +# This is also for Perl <5.32 which lacks: open(..., '+>>', undef) +# sub tmpfile ($;$$) { my ($id, $sock, $append) = @_; if (defined $sock) {