summaryrefslogtreecommitdiff
path: root/src/errors.c
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2008-12-30 23:26:38 -0800
committerShawn O. Pearce <spearce@spearce.org>2008-12-30 23:29:23 -0800
commit7dd8a9f71052cc12f8dd9c1eec2e99afbf08df76 (patch)
treecf5f7235b9c9689b133f6ea12015720b411329bd /src/errors.c
parent64a47c01426a36cdb7e598d17018d5791e54bb97 (diff)
downloadlibgit2-7dd8a9f71052cc12f8dd9c1eec2e99afbf08df76.tar.gz
Set GIT_EOSERR when the OS errno should be consulted
This error code indicates the OS error code has a better value describing the last error, as it is likely a network or local file IO problem identified by a C library function call. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'src/errors.c')
-rw-r--r--src/errors.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/errors.c b/src/errors.c
index deb106bfd..f3489977f 100644
--- a/src/errors.c
+++ b/src/errors.c
@@ -41,6 +41,9 @@ static struct {
const char *git_strerror(int num)
{
int i;
+
+ if (num == GIT_EOSERR)
+ return strerror(errno);
for (i = 0; i < ARRAY_SIZE(error_codes); i++)
if (num == error_codes[i].num)
return error_codes[i].str;