mirror of
https://git.proxmox.com/git/libgit2
synced 2026-01-03 19:35:06 +00:00
commit
63ad439405
@ -603,7 +603,7 @@ int gitfo_getcwd(char *buffer_out, size_t size)
|
||||
}
|
||||
|
||||
#ifdef GIT_WIN32
|
||||
static inline time_t filetime_to_time_t(const FILETIME *ft)
|
||||
GIT_INLINE(time_t) filetime_to_time_t(const FILETIME *ft)
|
||||
{
|
||||
long long winTime = ((long long)ft->dwHighDateTime << 32) + ft->dwLowDateTime;
|
||||
winTime -= 116444736000000000LL; /* Windows to Unix Epoch conversion */
|
||||
@ -627,7 +627,7 @@ static int do_lstat(const char *file_name, struct stat *buf)
|
||||
fMode |= S_IWRITE;
|
||||
|
||||
if (fdata.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)
|
||||
fMode |= _S_IFLNK;
|
||||
fMode |= S_IFLNK;
|
||||
|
||||
buf->st_ino = 0;
|
||||
buf->st_gid = 0;
|
||||
|
||||
@ -98,6 +98,9 @@ extern int gitfo_mv_force(const char *from, const char *to);
|
||||
#ifdef GIT_WIN32
|
||||
# define gitfo_lstat(p,b) gitfo_lstat__w32(p,b)
|
||||
# define gitfo_readlink(a, b, c) gitfo_readlink__w32(a, b, c)
|
||||
|
||||
extern int gitfo_lstat__w32(const char *file_name, struct stat *buf);
|
||||
extern int gitfo_readlink__w32(const char *link, char *target, size_t target_len);
|
||||
#else
|
||||
# define gitfo_lstat(p,b) lstat(p,b)
|
||||
# define gitfo_readlink(a, b, c) readlink(a, b, c)
|
||||
|
||||
@ -142,8 +142,8 @@ unsigned int index_create_mode(unsigned int mode)
|
||||
{
|
||||
if (S_ISLNK(mode))
|
||||
return S_IFLNK;
|
||||
if (S_ISDIR(mode) || (mode & S_IFMT) == 0160000)
|
||||
return 0160000;
|
||||
if (S_ISDIR(mode) || (mode & S_IFMT) == (S_IFLNK | S_IFDIR))
|
||||
return (S_IFLNK | S_IFDIR);
|
||||
return S_IFREG | ((mode & 0100) ? 0755 : 0644);
|
||||
}
|
||||
|
||||
|
||||
@ -12,14 +12,17 @@
|
||||
# define stat _stat64
|
||||
# define fstat _fstat64
|
||||
|
||||
#define _S_IFLNK 0120000
|
||||
|
||||
/* stat: file mode type testing macros */
|
||||
# define _S_IFLNK 0120000
|
||||
# define S_IFLNK _S_IFLNK
|
||||
|
||||
# define S_ISDIR(m) (((m) & _S_IFMT) == _S_IFDIR)
|
||||
# define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
|
||||
# define S_ISFIFO(m) (((m) & _S_IFMT) == _S_IFIFO)
|
||||
# define S_ISLNK(m) (((m) & _S_IFMT) == _S_IFLNK)
|
||||
|
||||
# define MAXPATHLEN MAX_PATH
|
||||
|
||||
/* case-insensitive string comparison */
|
||||
# define strcasecmp _stricmp
|
||||
# define strncasecmp _strnicmp
|
||||
|
||||
Loading…
Reference in New Issue
Block a user