diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2018-01-27 23:49:18 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2018-01-27 23:49:18 +0100 |
commit | 660b7bff81676aef6a7b068eb137efd74b30c628 (patch) | |
tree | 3ea973753abf23ae3a8a5b04a6f3e4bff6fbc5b1 /sysdeps/mach/hurd/getresuid.c | |
parent | 41cdb1eb5a3627c3b6b6c4f74503233d9689a397 (diff) | |
download | glibc-660b7bff81676aef6a7b068eb137efd74b30c628.tar.gz glibc-660b7bff81676aef6a7b068eb137efd74b30c628.tar.xz glibc-660b7bff81676aef6a7b068eb137efd74b30c628.zip |
hurd: fix warning
* sysdeps/mach/hurd/getresgid.c (__getresgid): Set result from critical section to make code simpler and avoid warning. * sysdeps/mach/hurd/getresuid.c (__getresuid): Set result from critical section to make code simpler and avoid warning.
Diffstat (limited to 'sysdeps/mach/hurd/getresuid.c')
-rw-r--r-- | sysdeps/mach/hurd/getresuid.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/sysdeps/mach/hurd/getresuid.c b/sysdeps/mach/hurd/getresuid.c index 1f2340350b..4af4786fc5 100644 --- a/sysdeps/mach/hurd/getresuid.c +++ b/sysdeps/mach/hurd/getresuid.c @@ -27,7 +27,6 @@ int __getresuid (uid_t *ruid, uid_t *euid, uid_t *suid) { error_t err; - uid_t real, eff, saved; HURD_CRITICAL_BEGIN; __mutex_lock (&_hurd_id.lock); @@ -40,22 +39,18 @@ __getresuid (uid_t *ruid, uid_t *euid, uid_t *suid) err = EGRATUITOUS; else { - real = _hurd_id.aux.uids[0]; - eff = _hurd_id.gen.nuids < 1 ? real : _hurd_id.gen.uids[0]; - saved = _hurd_id.aux.nuids < 2 ? real : _hurd_id.aux.uids[1]; + uid_t real = _hurd_id.aux.uids[0]; + + *ruid = real; + *euid = _hurd_id.gen.nuids < 1 ? real : _hurd_id.gen.uids[0]; + *suid = _hurd_id.aux.nuids < 2 ? real : _hurd_id.aux.uids[1]; } } __mutex_unlock (&_hurd_id.lock); HURD_CRITICAL_END; - if (err) - return __hurd_fail (err); - - *ruid = real; - *euid = eff; - *suid = saved; - return 0; + return __hurd_fail (err); } libc_hidden_def (__getresuid) weak_alias (__getresuid, getresuid) |