From dd0a48f50a97ca1185c957b0846e715be7777bcb Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Thu, 20 Apr 2023 23:21:42 +0200 Subject: getumask: Make it work on native Windows. * lib/getumask.c (getumask): When TMPDIR is unset, try TMP and TEMP. * tests/test-getumask.c (ASSUME_UMASK_CONSTANT): Define to 1 on native Windows. --- tests/test-getumask.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests') diff --git a/tests/test-getumask.c b/tests/test-getumask.c index 6ee50836bc..ab1e48ecd9 100644 --- a/tests/test-getumask.c +++ b/tests/test-getumask.c @@ -25,6 +25,11 @@ SIGNATURE_CHECK (getumask, mode_t, (void)); #include "macros.h" +#if defined _WIN32 && !defined __CYGWIN__ +/* On native Windows, getumask() always returns 0111. */ +# define ASSUME_UMASK_CONSTANT 1 +#endif + int main (void) { -- cgit v1.2.1