Archived
1
0
Fork 0

lockfile.c: in hold_lock(), Should report 'filename' instead of 'lock->name' if file is locked

This commit is contained in:
Henrik Hautakoski 2013-10-17 15:51:02 +02:00
parent 61cad77a0c
commit c731173b49

View file

@ -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;