]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
ds: remove needless O_APPEND import
authorEric Wong <e@80x24.org>
Wed, 19 Jun 2024 23:41:00 +0000 (23:41 +0000)
committerEric Wong <e@80x24.org>
Thu, 20 Jun 2024 22:41:56 +0000 (22:41 +0000)
tmpfile doesn't require O_APPEND to be specified, just a boolean
for whether or not the file requires O_APPEND.

lib/PublicInbox/DS.pm

index a6fec9546c571ec7e62495eebed7c70a5f73b789..ae0525dcbc2352ddcb96dd0d460dfb1834a21748 100644 (file)
@@ -25,7 +25,7 @@ use v5.10.1;
 use parent qw(Exporter);
 use bytes qw(length substr); # FIXME(?): needed for PublicInbox::NNTP
 use POSIX qw(WNOHANG sigprocmask SIG_SETMASK SIG_UNBLOCK);
-use Fcntl qw(SEEK_SET :DEFAULT O_APPEND);
+use Fcntl qw(SEEK_SET :DEFAULT);
 use Time::HiRes qw(clock_gettime CLOCK_MONOTONIC);
 use Scalar::Util qw(blessed);
 use PublicInbox::Syscall qw(%SIGNUM
@@ -471,7 +471,7 @@ sub drop {
 
 sub tmpio ($$$) {
        my ($self, $bref, $off) = @_;
-       my $fh = tmpfile('wbuf', $self->{sock}, O_APPEND) or
+       my $fh = tmpfile 'wbuf', $self->{sock}, 1 or
                return drop($self, "tmpfile $!");
        $fh->autoflush(1);
        my $len = length($$bref) - $off;