fix an error message (barf -> sysErrorBelch)
[ghc-hetmet.git] / rts / win32 / OSMem.c
index fe69a34..cdecf02 100644 (file)
@@ -7,6 +7,8 @@
  * ---------------------------------------------------------------------------*/
 
 #include <windows.h>
+#include "Rts.h"
+#include "OSMem.h"
 
 lnat getPageSize (void)
 {
@@ -24,11 +26,12 @@ lnat getPageSize (void)
 void setExecutable (void *p, lnat len, rtsBool exec)
 {
     DWORD dwOldProtect = 0;
-    if (VirtualProtect (addr, len, 
+    if (VirtualProtect (p, len, 
                        exec ? PAGE_EXECUTE_READWRITE : PAGE_READWRITE, 
                        &dwOldProtect) == 0)
     {
-       barf("makeExecutable: failed to protect 0x%p; error=%lu; old protection: %lu\n",
-            addr, (unsigned long)GetLastError(), (unsigned long)dwOldProtect);
+       sysErrorBelch("makeExecutable: failed to protect 0x%p; old protection: %lu\n",
+                      p, (unsigned long)dwOldProtect);
+        stg_exit(EXIT_FAILURE);
     }
 }