mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-30 22:58:46 +00: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
1 changed files with 1 additions and 1 deletions
|
@ -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
|
// 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
|
// 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.
|
// 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);
|
mode_t res = umask(guess);
|
||||||
if (res != guess) umask(res);
|
if (res != guess) umask(res);
|
||||||
return env_var_t(L"umask", format_string(L"0%0.3o", res));
|
return env_var_t(L"umask", format_string(L"0%0.3o", res));
|
||||||
|
|
Loading…
Reference in a new issue