diff options
author | Thorsten Lockert <tholo@cvs.openbsd.org> | 1996-09-15 09:32:02 +0000 |
---|---|---|
committer | Thorsten Lockert <tholo@cvs.openbsd.org> | 1996-09-15 09:32:02 +0000 |
commit | 5839b84db8fa4a49976868786c93b29df9c4d568 (patch) | |
tree | ef3d545e61baa18f319312ada4e97e2c799c24c6 /lib/libc/compat-43 | |
parent | 1d3f47d20a2b64c481a047ce24f39564b3e74533 (diff) |
Remove dead code
Remove unused variables
Silence some warnings
lint(1) is your friend
Diffstat (limited to 'lib/libc/compat-43')
-rw-r--r-- | lib/libc/compat-43/__setregid.c | 10 | ||||
-rw-r--r-- | lib/libc/compat-43/__setreuid.c | 10 |
2 files changed, 10 insertions, 10 deletions
diff --git a/lib/libc/compat-43/__setregid.c b/lib/libc/compat-43/__setregid.c index c13d2bbb133..c8f4d058708 100644 --- a/lib/libc/compat-43/__setregid.c +++ b/lib/libc/compat-43/__setregid.c @@ -32,7 +32,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: __setregid.c,v 1.2 1996/08/19 08:19:14 tholo Exp $"; +static char *rcsid = "$OpenBSD: __setregid.c,v 1.3 1996/09/15 09:30:44 tholo Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/types.h> @@ -43,20 +43,20 @@ int __setregid(rgid, egid) gid_t rgid, egid; { - static gid_t svgid = -1; + static gid_t svgid = (gid_t) -1; - if (svgid == -1) + if (svgid == (gid_t) -1) svgid = getegid(); /* * we assume that the intent of setting rgid is to be able to get * back rgid priviledge. So we make sure that we will be able to * do so, but do not actually set the rgid. */ - if (rgid != -1 && rgid != getgid() && rgid != svgid) { + if (rgid != (gid_t) -1 && rgid != getgid() && rgid != svgid) { errno = EPERM; return (-1); } - if (egid != -1 && setegid(egid) < 0) + if (egid != (gid_t) -1 && setegid(egid) < 0) return (-1); return (0); } diff --git a/lib/libc/compat-43/__setreuid.c b/lib/libc/compat-43/__setreuid.c index a62d627e485..cf8ac987ac1 100644 --- a/lib/libc/compat-43/__setreuid.c +++ b/lib/libc/compat-43/__setreuid.c @@ -32,7 +32,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: __setreuid.c,v 1.2 1996/08/19 08:19:15 tholo Exp $"; +static char *rcsid = "$OpenBSD: __setreuid.c,v 1.3 1996/09/15 09:30:45 tholo Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/types.h> @@ -43,20 +43,20 @@ int __setreuid(ruid, euid) uid_t ruid, euid; { - static uid_t svuid = -1; + static uid_t svuid = (uid_t) -1; - if (svuid == -1) + if (svuid == (uid_t) -1) svuid = geteuid(); /* * we assume that the intent of setting ruid is to be able to get * back ruid priviledge. So we make sure that we will be able to * do so, but do not actually set the ruid. */ - if (ruid != -1 && ruid != getuid() && ruid != svuid) { + if (ruid != (uid_t) -1 && ruid != getuid() && ruid != svuid) { errno = EPERM; return (-1); } - if (euid != -1 && seteuid(euid) < 0) + if (euid != (uid_t) -1 && seteuid(euid) < 0) return (-1); return (0); } |