summaryrefslogtreecommitdiff
path: root/sysdeps/mach/hurd/getresgid.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2007-07-12 18:26:36 +0000
committerJakub Jelinek <jakub@redhat.com>2007-07-12 18:26:36 +0000
commit0ecb606cb6cf65de1d9fc8a919bceb4be476c602 (patch)
tree2ea1f8305970753e4a657acb2ccc15ca3eec8e2c /sysdeps/mach/hurd/getresgid.c
parent7d58530341304d403a6626d7f7a1913165fe2f32 (diff)
downloadglibc-0ecb606cb6cf65de1d9fc8a919bceb4be476c602.tar.gz
2.5-18.1
Diffstat (limited to 'sysdeps/mach/hurd/getresgid.c')
-rw-r--r--sysdeps/mach/hurd/getresgid.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/sysdeps/mach/hurd/getresgid.c b/sysdeps/mach/hurd/getresgid.c
index a96aa49369..7847d213c4 100644
--- a/sysdeps/mach/hurd/getresgid.c
+++ b/sysdeps/mach/hurd/getresgid.c
@@ -1,5 +1,5 @@
-/* getresgid -- fetch effective group ID, real group ID, and saved-set group ID
- Copyright (C) 2002 Free Software Foundation, Inc.
+/* getresgid -- fetch real group ID, effective group ID, and saved-set group ID
+ Copyright (C) 2002, 2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,13 +22,13 @@
#include <hurd.h>
#include <hurd/id.h>
-/* Fetch the effective group ID, real group ID, and saved-set group ID,
+/* Fetch the real group ID, effective group ID, and saved-set group ID,
of the calling process. */
int
-__getresgid (gid_t *egid, gid_t *rgid, gid_t *sgid)
+__getresgid (gid_t *rgid, gid_t *egid, gid_t *sgid)
{
error_t err;
- gid_t eff, real, saved;
+ gid_t real, eff, saved;
HURD_CRITICAL_BEGIN;
__mutex_lock (&_hurd_id.lock);
@@ -42,8 +42,8 @@ __getresgid (gid_t *egid, gid_t *rgid, gid_t *sgid)
else
{
real = _hurd_id.aux.gids[0];
- saved = _hurd_id.aux.ngids < 2 ? real :_hurd_id.aux.gids[1];
eff = _hurd_id.gen.ngids < 1 ? real : _hurd_id.gen.gids[0];
+ saved = _hurd_id.aux.ngids < 2 ? real : _hurd_id.aux.gids[1];
}
}
@@ -53,8 +53,8 @@ __getresgid (gid_t *egid, gid_t *rgid, gid_t *sgid)
if (err)
return __hurd_fail (err);
- *egid = eff;
*rgid = real;
+ *egid = eff;
*sgid = saved;
return 0;
}