# [PATCH] Make the 'lock file' exists error more informative

2 messages from 2009-03-04 to 2009-03-04. Participants: John Tapsell.
Thread: https://gitlist.dev/t/18130

## John Tapsell, 2009-03-04 15:00

Subject: [PATCH] Make the 'lock file' exists error more informative
Message-ID: <1236178844-7958-1-git-send-email-johnflux@gmail.com>
URL: https://gitlist.dev/e/1236178844-7958-1-git-send-email-johnflux%40gmail.com

```
It looks like someone did 90% of the work, then forgot to actually use
the function
---
 lockfile.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lockfile.c b/lockfile.c
index 1db1a2f..6772f38 100644
--- a/lockfile.c
+++ b/lockfile.c
@@ -184,7 +184,7 @@ int hold_lock_file_for_append(struct lock_file *lk, const char *path, int flags)
 	fd = lock_file(lk, path, flags);
 	if (fd < 0) {
 		if (flags & LOCK_DIE_ON_ERROR)
-			die("unable to create '%s.lock': %s", path, strerror(errno));
+			unable_to_lock_index_die(path, strerror(errno));
 		return fd;
 	}
 
-- 
1.6.2.rc1.3.g7d31b.dirty

```

## John Tapsell, 2009-03-04 15:03

Subject: Re: [PATCH] Make the 'lock file' exists error more informative
Message-ID: <43d8ce650903040703v2a743797rc30724f8c1c608e7@mail.gmail.com>
URL: https://gitlist.dev/e/43d8ce650903040703v2a743797rc30724f8c1c608e7%40mail.gmail.com
In-Reply-To: <1236178844-7958-1-git-send-email-johnflux@gmail.com>

```
Argh, I'm so sorry.  After all that, I went and sent a broken version.
 Plus I just noticed another bug.  Will retry..


2009/3/4 John Tapsell <johnflux@gmail.com>:
> It looks like someone did 90% of the work, then forgot to actually use
> the function
> ---
>  lockfile.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/lockfile.c b/lockfile.c
> index 1db1a2f..6772f38 100644
> --- a/lockfile.c
> +++ b/lockfile.c
> @@ -184,7 +184,7 @@ int hold_lock_file_for_append(struct lock_file *lk, const char *path, int flags)
>        fd = lock_file(lk, path, flags);
>        if (fd < 0) {
>                if (flags & LOCK_DIE_ON_ERROR)
> -                       die("unable to create '%s.lock': %s", path, strerror(errno));
> +                       unable_to_lock_index_die(path, strerror(errno));
>                return fd;
>        }
>
> --
> 1.6.2.rc1.3.g7d31b.dirty
>
>

```
