diff options
author | Carlos Martín Nieto <cmn@dwim.me> | 2013-08-19 10:30:44 +0200 |
---|---|---|
committer | Carlos Martín Nieto <cmn@dwim.me> | 2013-08-19 10:30:44 +0200 |
commit | 3d2768747548ec24b58ebdaa012a6b757e65f5a0 (patch) | |
tree | ac7653603379d3b1bc406becb247105967264221 /src/fileops.c | |
parent | 8f81ea45ca107c992313f76ee73316f16751e64e (diff) | |
download | libgit2-3d2768747548ec24b58ebdaa012a6b757e65f5a0.tar.gz |
index: report when it's locked
Report the index being locked with its own error code in order to be
able to differentiate, as a locked index is typically the result of a
crashed process or concurrent access, both of which often require user
intervention to fix.
Diffstat (limited to 'src/fileops.c')
-rw-r--r-- | src/fileops.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/fileops.c b/src/fileops.c index 3a5a53074..76119e02e 100644 --- a/src/fileops.c +++ b/src/fileops.c @@ -70,7 +70,7 @@ int git_futils_creat_locked(const char *path, const mode_t mode) if (fd < 0) { giterr_set(GITERR_OS, "Failed to create locked file '%s'", path); - return -1; + return errno == EEXIST ? GIT_ELOCKED : -1; } return fd; |