From a5b633d3a5ec69fef38098518045e958a051215c Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Wed, 29 May 2019 20:24:40 +0200 Subject: [PATCH] env: Correct type We'd be comparing "int" and "mode_t", and "mode_t" might be unsigned. Found via GCC warning. --- src/env.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/env.cpp b/src/env.cpp index 9ea544d6a..12ab94fb8 100644 --- a/src/env.cpp +++ b/src/env.cpp @@ -658,7 +658,7 @@ maybe_t env_scoped_impl_t::try_get_computed(const wcstring &key) cons // note umask() is an absurd API: you call it to set the value and it returns the old // value. Thus we have to call it twice, to reset the value. The env_lock protects // against races. Guess what the umask is; if we guess right we don't need to reset it. - int guess = 022; + mode_t guess = 022; mode_t res = umask(guess); if (res != guess) umask(res); return env_var_t(L"umask", format_string(L"0%0.3o", res));