mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
pstore abort handle
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@749 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
50cb050bd7
commit
97f8593cf8
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue