diff options
author | H. Peter Anvin <hpa@zytor.com> | 2002-09-11 05:00:58 +0000 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2002-09-11 05:00:58 +0000 |
commit | 7599d58d8487bc608b6f15b81dda6fa5e1a7bcad (patch) | |
tree | 27bf82273983d4be2a674b599fc023d7a1ed545f | |
parent | 320a6e99b10998fe3e0eff31b7ac81a65abdf9e9 (diff) | |
download | klibc-7599d58d8487bc608b6f15b81dda6fa5e1a7bcad.tar.gz |
Be a little more anal about the definition of these...klibc-0.68
-rw-r--r-- | klibc/setresgid.c | 14 | ||||
-rw-r--r-- | klibc/setresuid.c | 14 |
2 files changed, 18 insertions, 10 deletions
diff --git a/klibc/setresgid.c b/klibc/setresgid.c index 5a6634ebc693c..f1a8c6b45c3b1 100644 --- a/klibc/setresgid.c +++ b/klibc/setresgid.c @@ -15,11 +15,15 @@ static inline _syscall3(int,setresgid32,gid_t,a0,gid_t,a1,gid_t,a2); int setresgid(gid_t a0, gid_t a1, gid_t a2) { - uint32_t x0 = (a0 == (gid_t)-1) ? (uint32_t)-1 : a0; - uint32_t x1 = (a1 == (gid_t)-1) ? (uint32_t)-1 : a1; - uint32_t x2 = (a2 == (gid_t)-1) ? (uint32_t)-1 : a2; - - return setresgid32(x0,x1,x2); + if ( sizeof(gid_t) == sizeof(uint32_t) ) { + return setresgid32(a0,a1,a2); + } else { + uint32_t x0 = (a0 == (gid_t)-1) ? (uint32_t)-1 : a0; + uint32_t x1 = (a1 == (gid_t)-1) ? (uint32_t)-1 : a1; + uint32_t x2 = (a2 == (gid_t)-1) ? (uint32_t)-1 : a2; + + return setresgid32(x0,x1,x2); + } } #endif diff --git a/klibc/setresuid.c b/klibc/setresuid.c index 5a4a62c301070..a587acbae3d2b 100644 --- a/klibc/setresuid.c +++ b/klibc/setresuid.c @@ -15,11 +15,15 @@ static inline _syscall3(int,setresuid32,uid_t,a0,uid_t,a1,uid_t,a2); int setresuid(uid_t a0, uid_t a1, uid_t a2) { - uint32_t x0 = (a0 == (uid_t)-1) ? (uint32_t)-1 : a0; - uint32_t x1 = (a1 == (uid_t)-1) ? (uint32_t)-1 : a1; - uint32_t x2 = (a2 == (uid_t)-1) ? (uint32_t)-1 : a2; - - return setresuid32(x0,x1,x2); + if ( sizeof(uid_t) == sizeof(uint32_t) ) { + return setresuid32(a0,a1,a2); + } else { + uint32_t x0 = (a0 == (uid_t)-1) ? (uint32_t)-1 : a0; + uint32_t x1 = (a1 == (uid_t)-1) ? (uint32_t)-1 : a1; + uint32_t x2 = (a2 == (uid_t)-1) ? (uint32_t)-1 : a2; + + return setresuid32(x0,x1,x2); + } } #endif |