summaryrefslogtreecommitdiff
path: root/src/fileops.c
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2013-08-19 10:30:44 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2013-08-19 10:30:44 +0200
commit3d2768747548ec24b58ebdaa012a6b757e65f5a0 (patch)
treeac7653603379d3b1bc406becb247105967264221 /src/fileops.c
parent8f81ea45ca107c992313f76ee73316f16751e64e (diff)
downloadlibgit2-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.c2
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;