Description:
fixed bug in dir_init teardown (wrong log filename)
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r109:f75d1acc9cdd - - 1 file changed: 6 inserted, 2 deleted
@@ -22,10 +22,14 | |||||
|
22 | @usage_filename = usage_filename |
|
22 | @usage_filename = usage_filename |
|
23 | end |
|
23 | end |
|
24 |
|
24 | ||
|
|
25 | + def lock_filename | ||
|
|
26 | + return @dir_name + '/lockfile' | ||
|
|
27 | + end | ||
|
|
28 | + | ||
|
25 | # Check if someone has initialized the dir. If not, call block. |
|
29 | # Check if someone has initialized the dir. If not, call block. |
|
26 |
|
30 | ||
|
27 | def setup # :yields: block |
|
31 | def setup # :yields: block |
|
28 |
- dir = File.new( |
|
32 | + dir = File.new(lock_filename,"w+") |
|
29 | dir.flock(File::LOCK_EX) |
|
33 | dir.flock(File::LOCK_EX) |
|
30 | begin |
|
34 | begin |
|
31 | counter_filename = get_counter_filename |
|
35 | counter_filename = get_counter_filename |
@@ -64,7 +68,7 | |||||
|
64 | # Check if I am the last one using the dir. If true, call block. |
|
68 | # Check if I am the last one using the dir. If true, call block. |
|
65 |
|
69 | ||
|
66 | def teardown |
|
70 | def teardown |
|
67 |
- dir = File.new( |
|
71 | + dir = File.new(lock_filename) |
|
68 | dir.flock(File::LOCK_EX) |
|
72 | dir.flock(File::LOCK_EX) |
|
69 | begin |
|
73 | begin |
|
70 | counter_filename = get_counter_filename |
|
74 | counter_filename = get_counter_filename |
You need to be logged in to leave comments.
Login now