summaryrefslogtreecommitdiff
path: root/rts
diff options
context:
space:
mode:
authorEdward Z. Yang <ezyang@mit.edu>2013-09-17 19:59:17 -0700
committerEdward Z. Yang <ezyang@mit.edu>2013-09-17 19:59:17 -0700
commit53b2dc8dda92bb3d8606857eb9ee95e25893498c (patch)
treef1502855cc82c7340f6127a6ffaab5475e52e922 /rts
parentf4046b508a5a71ff2e28f438b30048867dbad428 (diff)
downloadhaskell-53b2dc8dda92bb3d8606857eb9ee95e25893498c.tar.gz
Suppress unused variable when OS does not support setuid.
Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
Diffstat (limited to 'rts')
-rw-r--r--rts/RtsFlags.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/rts/RtsFlags.c b/rts/RtsFlags.c
index 4f850b583c..bf924c25f7 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)
{