summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-06-13 09:04:40 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-06-13 09:04:40 +0000
commit00c5f6b1e53ab40c95e5da02ff8bfb9d5631c00a (patch)
tree8c0bca56009d4375a740e7d62dcb38b5d70fcab3
parentbbbea4394fb6ff5bc14187ca77f23f36cdddcf72 (diff)
downloadruby-00c5f6b1e53ab40c95e5da02ff8bfb9d5631c00a.tar.gz
ruby-00c5f6b1e53ab40c95e5da02ff8bfb9d5631c00a.tar.xz
ruby-00c5f6b1e53ab40c95e5da02ff8bfb9d5631c00a.zip
pstore abort handle
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@749 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--lib/pstore.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/pstore.rb b/lib/pstore.rb
index 05fa5dccc..409fc6dfc 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