[commit: ghc] master: Suppress unused variable when OS does not support setuid. (53b2dc8)
git at git.haskell.org
git at git.haskell.org
Wed Sep 18 05:42:34 CEST 2013
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/53b2dc8dda92bb3d8606857eb9ee95e25893498c/ghc
>---------------------------------------------------------------
commit 53b2dc8dda92bb3d8606857eb9ee95e25893498c
Author: Edward Z. Yang <ezyang at mit.edu>
Date: Tue Sep 17 19:59:17 2013 -0700
Suppress unused variable when OS does not support setuid.
Signed-off-by: Edward Z. Yang <ezyang at mit.edu>
>---------------------------------------------------------------
53b2dc8dda92bb3d8606857eb9ee95e25893498c
rts/RtsFlags.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/rts/RtsFlags.c b/rts/RtsFlags.c
index 4f850b5..bf924c2 100644
--- a/rts/RtsFlags.c
+++ b/rts/RtsFlags.c
@@ -578,19 +578,23 @@ void setupRtsFlags (int *argc, char *argv[],
* procRtsOpts: Process rts_argv between rts_argc0 and rts_argc.
* -------------------------------------------------------------------------- */
+#if defined(HAVE_UNISTD_H) && defined(HAVE_SYS_TYPES_H) && !defined(mingw32_HOST_OS)
static void checkSuid(HsBool is_hs_main, RtsOptsEnabledEnum enabled)
{
if (enabled == RtsOptsSafeOnly) {
-#if defined(HAVE_UNISTD_H) && defined(HAVE_SYS_TYPES_H) && !defined(mingw32_HOST_OS)
/* This doesn't cover linux/posix capabilities like CAP_DAC_OVERRIDE,
we'd have to link with -lcap for that. */
if ((getuid() != geteuid()) || (getgid() != getegid())) {
errorRtsOptsDisabled(is_hs_main, "RTS options are disabled for setuid binaries. %s");
stg_exit(EXIT_FAILURE);
}
-#endif
}
}
+#else
+static void checkSuid(HsBool is_hs_main STG_UNUSED, RtsOptsEnabledEnum enabled STG_UNUSED)
+{
+}
+#endif
static void checkUnsafe(HsBool is_hs_main, RtsOptsEnabledEnum enabled)
{
More information about the ghc-commits
mailing list