Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
7f13edfd
Commit
7f13edfd
authored
Nov 01, 2013
by
Vicent Martí
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1935 from ethomson/winerrs
preserve windows error numbers as well
parents
567649f2
c2408a69
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
2 deletions
+26
-2
src/common.h
+24
-0
src/fileops.c
+2
-2
No files found.
src/common.h
View file @
7f13edfd
...
...
@@ -74,6 +74,30 @@ void giterr_set(int error_class, const char *string, ...);
int
giterr_set_regex
(
const
regex_t
*
regex
,
int
error_code
);
/**
* Gets the system error code for this thread.
*/
GIT_INLINE
(
int
)
giterr_system_last
(
void
)
{
#ifdef GIT_WIN32
return
GetLastError
();
#else
return
errno
;
#endif
}
/**
* Sets the system error code for this thread.
*/
GIT_INLINE
(
void
)
giterr_system_set
(
int
code
)
{
#ifdef GIT_WIN32
SetLastError
(
code
);
#else
errno
=
code
;
#endif
}
/**
* Check a versioned structure for validity
*/
GIT_INLINE
(
int
)
giterr__check_version
(
const
void
*
structure
,
unsigned
int
expected_max
,
const
char
*
name
)
...
...
src/fileops.c
View file @
7f13edfd
...
...
@@ -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
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment