mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-24 16:19:13 +08:00
env: Correct type
We'd be comparing "int" and "mode_t", and "mode_t" might be unsigned. Found via GCC warning.
This commit is contained in:
parent
e895cef245
commit
a5b633d3a5
|
@ -658,7 +658,7 @@ maybe_t<env_var_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));
|
||||
|
|
Loading…
Reference in New Issue
Block a user