summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>1994-05-17 03:09:02 +0000
committerRoland McGrath <roland@redhat.com>1994-05-17 03:09:02 +0000
commitcf76b42f2b0220630f59f8985b0d39bdefc35e60 (patch)
treeb75a4614b0ae0833d7a7417054676db672d43016
parentfb088e4526bd2977fb72a53f6eb44ac07b9f0398 (diff)
downloadgunmake-cf76b42f2b0220630f59f8985b0d39bdefc35e60.tar.gz
[GETLOADAVG_PRIVILEGED] [! POSIX]: Undefine HAVE_SETEUID and HAVE_SETEGID.
-rw-r--r--misc.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/misc.c b/misc.c
index 8c281f3..0b8c3cd 100644
--- a/misc.c
+++ b/misc.c
@@ -454,6 +454,7 @@ dep_name (dep)
#ifdef GETLOADAVG_PRIVILEGED
#ifdef POSIX
+
/* Hopefully if a system says it's POSIX.1 and has the setuid and setgid
functions, they work as POSIX.1 says. Some systems (Alpha OSF/1 1.2,
for example) which claim to be POSIX.1 also have the BSD setreuid and
@@ -466,7 +467,18 @@ dep_name (dep)
#if defined (HAVE_SETREGID) && defined (HAVE_SETGID)
#undef HAVE_SETREGID
#endif
-#endif
+
+#else /* Not POSIX. */
+
+/* Some POSIX.1 systems have the seteuid and setegid functions. In a
+ POSIX-like system, they are the best thing to use. However, some
+ non-POSIX systems have them too but they do not work in the POSIX style
+ and we must use setreuid and setregid instead. */
+
+#undef HAVE_SETEUID
+#undef HAVE_SETEGID
+
+#endif /* POSIX. */
#ifndef HAVE_UNISTD_H
extern int getuid (), getgid (), geteuid (), getegid ();