Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c1b75f0

Browse files
committed
Merge pull request libgit2#3604 from ethomson/nsec_xplat
Handle `USE_NSECS`
2 parents b85d0af + 9447b9e commit c1b75f0

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/common.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@
6262
# endif
6363
#define GIT_STDLIB_CALL
6464

65+
#ifdef GIT_USE_STAT_ATIMESPEC
66+
# define st_atim st_atimespec
67+
# define st_ctim st_ctimespec
68+
# define st_mtim st_mtimespec
69+
#endif
70+
6571
# include <arpa/inet.h>
6672

6773
#endif

src/fileops.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,6 @@
1313
#include "win32/findfile.h"
1414
#endif
1515

16-
#ifdef GIT_USE_STAT_ATIMESPEC
17-
#define st_atim st_atimespec
18-
#define st_ctim st_ctimespec
19-
#define st_mtim st_mtimespec
20-
#endif
21-
2216
GIT__USE_STRMAP
2317

2418
int git_futils_mkpath2file(const char *file_path, const mode_t mode)

src/index.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ GIT_INLINE(bool) git_index_entry_newer_than_index(
9292

9393
/* If the timestamp is the same or newer than the index, it's racy */
9494
#if defined(GIT_USE_NSEC)
95-
if ((int32_t)index->stamp.tv_sec < entry->mtime.seconds)
95+
if ((int32_t)index->stamp.mtime.tv_sec < entry->mtime.seconds)
9696
return true;
9797
else if ((int32_t)index->stamp.mtime.tv_sec > entry->mtime.seconds)
9898
return false;

0 commit comments

Comments
 (0)