summaryrefslogtreecommitdiff
path: root/src/fileops.c
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@microsoft.com>2013-11-01 17:03:01 -0400
committerEdward Thomson <ethomson@microsoft.com>2013-11-01 17:27:07 -0400
commitc2408a698ad395c8bd84297de839080d131c6d6d (patch)
treeebf4edc55b76df48267257c9d20681ae7e6b246f /src/fileops.c
parent567649f2ada60e5c3009cc985af238b452b14a81 (diff)
downloadlibgit2-c2408a698ad395c8bd84297de839080d131c6d6d.tar.gz
preserve windows error numbers as well
Diffstat (limited to 'src/fileops.c')
-rw-r--r--src/fileops.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/fileops.c b/src/fileops.c
index 17007f823..54bf5d850 100644
--- a/src/fileops.c
+++ b/src/fileops.c
@@ -343,11 +343,11 @@ int git_futils_mkdir(
/* make directory */
if (p_mkdir(make_path.ptr, mode) < 0) {
- int tmp_errno = errno;
+ int tmp_errno = giterr_system_last();
/* ignore error if directory already exists */
if (p_stat(make_path.ptr, &st) < 0 || !S_ISDIR(st.st_mode)) {
- errno = tmp_errno;
+ giterr_system_set(tmp_errno);
giterr_set(GITERR_OS, "Failed to make directory '%s'", make_path.ptr);
goto done;
}