]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
emergency: remove needless $! clobber
authorEric Wong <e@80x24.org>
Sat, 18 Jan 2025 01:26:16 +0000 (01:26 +0000)
committerEric Wong <e@80x24.org>
Tue, 21 Jan 2025 22:37:04 +0000 (22:37 +0000)
We don't check $! unless `sysopen' fails, and `sysopen' will set
$! on failure so there's no need to undef $! ourselves.

lib/PublicInbox/Emergency.pm

index d3a83408f12283ff08e2ecd2e09227ad31745c1b..7e9faad02bd7b2e1af5068ebee052536620cfa0a 100644 (file)
@@ -39,7 +39,6 @@ sub prepare {
        my ($tmp, $fh);
        do {
                $tmp = _fn_in($self, $pid, 'tmp');
-               $! = undef;
        } while (!sysopen($fh, $tmp, O_CREAT|O_EXCL|O_RDWR) and $! == EEXIST);
        print $fh $$strref or die "print: $!";
        $fh->flush or die "flush: $!";