X-Git-Url: https://git.sommitrealweird.co.uk/onak.git/blobdiff_plain/d393825d164f31fe0194221b6ed90f3c320d8d44..fc7531131a7ccb7176f80ead865eee12b97a164c:/onak-mail.pl.in?ds=sidebyside diff --git a/onak-mail.pl.in b/onak-mail.pl.in index 77a3d36..96fce71 100644 --- a/onak-mail.pl.in +++ b/onak-mail.pl.in @@ -212,11 +212,12 @@ my $tmpfile = sprintf "%s/%04d%02d%02d-%02d%02d%02d-%d.onak", $time[1], $time[0], $$; -open(MAILFILE, '>'.$tmpfile); +open(MAILFILE, '>'.$tmpfile.'.tmp'); while (<>) { print MAILFILE $_; } close(MAILFILE); +rename $tmpfile.".tmp", $tmpfile; # # Lock here to ensure that only one copy of us is processing the incoming