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
cd768280
Commit
cd768280
authored
Sep 29, 2015
by
Edward Thomson
Committed by
Carlos Martín Nieto
Nov 04, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
p_futimes: support using futimens when available
parent
08a2a939
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
1 deletions
+20
-1
CMakeLists.txt
+6
-0
src/unix/posix.h
+14
-1
No files found.
CMakeLists.txt
View file @
cd768280
...
@@ -19,6 +19,7 @@ CMAKE_POLICY(SET CMP0015 NEW)
...
@@ -19,6 +19,7 @@ CMAKE_POLICY(SET CMP0015 NEW)
SET
(
CMAKE_MODULE_PATH
${
CMAKE_MODULE_PATH
}
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/cmake/Modules/"
)
SET
(
CMAKE_MODULE_PATH
${
CMAKE_MODULE_PATH
}
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/cmake/Modules/"
)
INCLUDE
(
CheckLibraryExists
)
INCLUDE
(
CheckLibraryExists
)
INCLUDE
(
CheckFunctionExists
)
INCLUDE
(
AddCFlagIfSupported
)
INCLUDE
(
AddCFlagIfSupported
)
INCLUDE
(
FindPkgConfig
)
INCLUDE
(
FindPkgConfig
)
...
@@ -447,6 +448,11 @@ ELSE ()
...
@@ -447,6 +448,11 @@ ELSE ()
ADD_C_FLAG_IF_SUPPORTED
(
-Wno-unused-const-variable
)
ADD_C_FLAG_IF_SUPPORTED
(
-Wno-unused-const-variable
)
ADD_C_FLAG_IF_SUPPORTED
(
-Wno-unused-function
)
ADD_C_FLAG_IF_SUPPORTED
(
-Wno-unused-function
)
CHECK_FUNCTION_EXISTS
(
futimens HAVE_FUTIMENS
)
IF
(
HAVE_FUTIMENS
)
ADD_DEFINITIONS
(
-DHAVE_FUTIMENS
)
ENDIF
()
IF
(
APPLE
)
# Apple deprecated OpenSSL
IF
(
APPLE
)
# Apple deprecated OpenSSL
ADD_C_FLAG_IF_SUPPORTED
(
-Wno-deprecated-declarations
)
ADD_C_FLAG_IF_SUPPORTED
(
-Wno-deprecated-declarations
)
ENDIF
()
ENDIF
()
...
...
src/unix/posix.h
View file @
cd768280
...
@@ -22,7 +22,6 @@ typedef int GIT_SOCKET;
...
@@ -22,7 +22,6 @@ typedef int GIT_SOCKET;
#define p_stat(p,b) stat(p, b)
#define p_stat(p,b) stat(p, b)
#define p_utimes(f, t) utimes(f, t)
#define p_utimes(f, t) utimes(f, t)
#define p_futimes(f, t) futimes(f, t)
#define p_readlink(a, b, c) readlink(a, b, c)
#define p_readlink(a, b, c) readlink(a, b, c)
#define p_symlink(o,n) symlink(o, n)
#define p_symlink(o,n) symlink(o, n)
...
@@ -53,4 +52,18 @@ extern char *p_realpath(const char *, char *);
...
@@ -53,4 +52,18 @@ extern char *p_realpath(const char *, char *);
#define p_localtime_r(c, r) localtime_r(c, r)
#define p_localtime_r(c, r) localtime_r(c, r)
#define p_gmtime_r(c, r) gmtime_r(c, r)
#define p_gmtime_r(c, r) gmtime_r(c, r)
#ifdef HAVE_FUTIMENS
GIT_INLINE
(
int
)
p_futimes
(
int
f
,
const
struct
timeval
t
[
2
])
{
struct
timespec
s
[
2
];
s
[
0
].
tv_sec
=
t
[
0
].
tv_sec
;
s
[
0
].
tv_nsec
=
t
[
0
].
tv_usec
*
1000
;
s
[
1
].
tv_sec
=
t
[
1
].
tv_sec
;
s
[
1
].
tv_nsec
=
t
[
1
].
tv_usec
*
1000
;
return
futimens
(
f
,
s
);
}
#else
# define p_futimes futimes
#endif
#endif
#endif
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