From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, T_SCC_BODY_TEXT_LINE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id CA766D48B6 for ; Wed, 19 Jun 2024 23:41:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1718840484; bh=EoXJcsQBuQsbBhEHyjTF2xPlrZuzF2QMSrj3e4An7L8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=gbUrL3DcLgEOM+zLNBCj9flXjipFS6002hcBw1jMIuvUV3C0GD+HmZPLs6Ln7YxkN 3T4KjdoQFosHW4tboO/JEHxD/TyJ4IjmIkYRWi2kCkslyLjX6R+8zE8oXLmj6FE1Oc y/C8JWUB/qzUWvJ0H4hBrwNC0MCRr7FA+tGs0ArQ= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 1/5] ds: remove needless O_APPEND import Date: Wed, 19 Jun 2024 23:41:00 +0000 Message-ID: <20240619234104.80183-2-e@80x24.org> In-Reply-To: <20240619234104.80183-1-e@80x24.org> References: <20240619234104.80183-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/PublicInbox/DS.pm b/lib/PublicInbox/DS.pm index a6fec954..ae0525dc 100644 --- a/lib/PublicInbox/DS.pm +++ b/lib/PublicInbox/DS.pm @@ -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;