Define S_IFMT and S_IFLNK in pyport.h so posixmodule.c can use named constants instead

of arbitrary looking numbers.
This commit is contained in:
Christian Heimes 2013-06-23 23:56:05 +02:00
parent 9975877f46
commit 99d6135a15
2 changed files with 10 additions and 9 deletions

View file

@ -1405,9 +1405,9 @@ attribute_data_to_stat(BY_HANDLE_FILE_INFORMATION *info, ULONG reparse_tag, stru
result->st_ino = (((__int64)info->nFileIndexHigh)<<32) + info->nFileIndexLow;
if (reparse_tag == IO_REPARSE_TAG_SYMLINK) {
/* first clear the S_IFMT bits */
result->st_mode ^= (result->st_mode & 0170000);
result->st_mode ^= (result->st_mode & S_IFMT);
/* now set the bits that make this a symlink */
result->st_mode |= 0120000;
result->st_mode |= S_IFLNK;
}
return 0;