[v2,2/6,gdb/testsuite] Improve variable names in lock_file_{acquire, release}
Checks
| Context |
Check |
Description |
| linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 |
success
|
Build passed
|
| linaro-tcwg-bot/tcwg_gdb_build--master-arm |
success
|
Build passed
|
Commit Message
In lock_file_acquire we assign the result of a call to proc open to a variable
called rc.
Use fh for file handle instead.
Then use the variable names fh and lockfile as used in lock_file_acquire in
lock_file_release.
---
gdb/testsuite/lib/gdb-utils.exp | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)
@@ -188,14 +188,14 @@ proc lock_file_acquire {lockfile} {
while {true} {
try {
open $lockfile {WRONLY CREAT EXCL}
- } on ok {rc} {
+ } on ok {fh} {
set msg "locked by $::subdir/${::gdb_test_file_name}.exp"
verbose -log "lock file: $msg"
# For debugging, put info in the lockfile about who owns
# it.
- puts $rc $msg
- flush $rc
- return [list $rc $lockfile]
+ puts $fh $msg
+ flush $fh
+ return [list $fh $lockfile]
} on error {} {
# Ignore and try again.
}
@@ -208,17 +208,20 @@ proc lock_file_acquire {lockfile} {
proc lock_file_release {info} {
verbose -log "releasing lock file: $::subdir/${::gdb_test_file_name}.exp"
+ set fh [lindex $info 0]
+ set lockfile [lindex $info 1]
+
try {
- fconfigure [lindex $info 0]
+ fconfigure $fh
} on error {} {
error "invalid lock"
}
try {
- close [lindex $info 0]
- file delete -force [lindex $info 1]
- } on error {rc} {
- error "Error releasing lockfile: '$rc'"
+ close $fh
+ file delete -force $lockfile
+ } on error {err_msg} {
+ error "Error releasing lockfile: '$err_msg'"
}
return ""