From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id BB1EF1F4C3 for ; Fri, 8 Nov 2019 20:20:20 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 2/2] edit: check for write errors writing "From_" line Date: Fri, 8 Nov 2019 20:20:18 +0000 Message-Id: <20191108202018.15680-3-e@80x24.org> In-Reply-To: <20191108202018.15680-1-e@80x24.org> References: <20191108202018.15680-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: We need to check every print to a regular file for errors, because storage devices inevitably fail. --- script/public-inbox-edit | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/script/public-inbox-edit b/script/public-inbox-edit index 24b7ed8b..43ce9900 100755 --- a/script/public-inbox-edit +++ b/script/public-inbox-edit @@ -130,7 +130,8 @@ foreach my $to_edit (values %$found) { my $tmp = $$old_raw; if (!$opt->{raw}) { my $oid = $smsg->{blob}; - print $edit_fh "From mboxrd\@$oid Thu Jan 1 00:00:00 1970\n"; + print $edit_fh "From mboxrd\@$oid Thu Jan 1 00:00:00 1970\n" + or die "failed to write From_ line: $!"; $tmp =~ s/^(>*From )/>$1/gm; } print $edit_fh $tmp or