diff options
author | Trent Nelson <trent@trent.me> | 2012-09-19 01:50:06 (GMT) |
---|---|---|
committer | Trent Nelson <trent@trent.me> | 2012-09-19 01:50:06 (GMT) |
commit | 9a46105a897f6a4d6e2cf74cdb215d934fab76d9 (patch) | |
tree | ebebe7b0a27de63e3d808e55b0ab0dd69e159da8 /Modules | |
parent | 1da769a30295eb9e4acb5367b49c7cb21ca255cb (diff) | |
download | cpython-9a46105a897f6a4d6e2cf74cdb215d934fab76d9.zip cpython-9a46105a897f6a4d6e2cf74cdb215d934fab76d9.tar.gz cpython-9a46105a897f6a4d6e2cf74cdb215d934fab76d9.tar.bz2 |
#15965: Explicitly cast AT_FDCWD as (int).
Required on Solaris 10 (which defines AT_FDCWD as 0xffd19553),
harmless on other platforms.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/posixmodule.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 54f6cd2..e0efebf 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -414,7 +414,14 @@ win32_warn_bytes_api() #ifdef AT_FDCWD -#define DEFAULT_DIR_FD AT_FDCWD +/* + * Why the (int) cast? Solaris 10 defines AT_FDCWD as 0xffd19553 (-3041965); + * without the int cast, the value gets interpreted as uint (4291925331), + * which doesn't play nicely with all the initializer lines in this file that + * look like this: + * int dir_fd = DEFAULT_DIR_FD; + */ +#define DEFAULT_DIR_FD (int)AT_FDCWD #else #define DEFAULT_DIR_FD (-100) #endif |