From 97f8593cf8af3b44e170fee5aca9b0a521cd3ffd Mon Sep 17 00:00:00 2001 From: matz Date: Tue, 13 Jun 2000 09:04:40 +0000 Subject: pstore abort handle git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@749 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/pstore.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/pstore.rb') diff --git a/lib/pstore.rb b/lib/pstore.rb index 05fa5dccc7..409fc6dfc0 100644 --- a/lib/pstore.rb +++ b/lib/pstore.rb @@ -88,14 +88,14 @@ class PStore file = File::open(@filename, "r+") orig = true else + @table = {} file = File::open(@filename, "w+") + Marshal::dump(@table, file) end file.flock(File::LOCK_EX) if orig File::copy @filename, backup @table = Marshal::load(file) - else - @table = {} end begin catch(:pstore_abort_transaction) do -- cgit v1.2.3