Suppress unused variable when OS does not support setuid.
authorEdward Z. Yang <ezyang@mit.edu>
Wed, 18 Sep 2013 02:59:17 +0000 (19:59 -0700)
committerEdward Z. Yang <ezyang@mit.edu>
Wed, 18 Sep 2013 02:59:17 +0000 (19:59 -0700)
Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
rts/RtsFlags.c

index 4f850b5..bf924c2 100644 (file)
@@ -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)
 {