lockfile.c: in hold_lock(), Should report 'filename' instead of 'lock->name' if file is locked
This commit is contained in:
parent
61cad77a0c
commit
c731173b49
1 changed files with 4 additions and 2 deletions
|
|
@ -145,8 +145,10 @@ int hold_lock(struct lockfile *lock, const char *filename, int force) {
|
|||
|
||||
lock->fd = open_lock(lock->name, force);
|
||||
if (lock->fd < 0) {
|
||||
return error(errno == EEXIST ? "'%s' is locked" :
|
||||
"unable to create lockfile '%s'", lock->name);
|
||||
if (errno == EEXIST)
|
||||
return error("'%s' is locked", filename);
|
||||
|
||||
return error("unable to create lockfile '%s'", lock->name);
|
||||
}
|
||||
|
||||
lock->next = active_locks;
|
||||
|
|
|
|||
Reference in a new issue