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
@ -88,14 +88,14 @@ class PStore
|
|||||||
file = File::open(@filename, "r+")
|
file = File::open(@filename, "r+")
|
||||||
orig = true
|
orig = true
|
||||||
else
|
else
|
||||||
|
@table = {}
|
||||||
file = File::open(@filename, "w+")
|
file = File::open(@filename, "w+")
|
||||||
|
Marshal::dump(@table, file)
|
||||||
end
|
end
|
||||||
file.flock(File::LOCK_EX)
|
file.flock(File::LOCK_EX)
|
||||||
if orig
|
if orig
|
||||||
File::copy @filename, backup
|
File::copy @filename, backup
|
||||||
@table = Marshal::load(file)
|
@table = Marshal::load(file)
|
||||||
else
|
|
||||||
@table = {}
|
|
||||||
end
|
end
|
||||||
begin
|
begin
|
||||||
catch(:pstore_abort_transaction) do
|
catch(:pstore_abort_transaction) do
|
||||||
|
Loading…
x
Reference in New Issue
Block a user