From eea8a8a60c94984fc60eb8642f44e24453f2e1ae Mon Sep 17 00:00:00 2001 From: fukachan Date: Tue, 25 May 2004 04:03:49 +0000 Subject: check temporary file is non-zero. --- fml/lib/IO/Adapter/AtomicFile.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fml/lib/IO/Adapter/AtomicFile.pm b/fml/lib/IO/Adapter/AtomicFile.pm index cf62cd44..c66edc4e 100644 --- a/fml/lib/IO/Adapter/AtomicFile.pm +++ b/fml/lib/IO/Adapter/AtomicFile.pm @@ -4,7 +4,7 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: AtomicFile.pm,v 1.10 2004/01/24 09:00:53 fukachan Exp $ +# $FML: AtomicFile.pm,v 1.11 2004/02/15 04:38:36 fukachan Exp $ # package IO::Adapter::AtomicFile; @@ -197,7 +197,7 @@ sub close $fh->SUPER::close(); } - if (rename($temp, $orig)) { + if (-s $temp && rename($temp, $orig)) { return 1; } else { -- cgit v1.2.1