[project @ 2003-03-18 10:28:15 by simonmar]
authorsimonmar <unknown>
Tue, 18 Mar 2003 10:28:15 +0000 (10:28 +0000)
committersimonmar <unknown>
Tue, 18 Mar 2003 10:28:15 +0000 (10:28 +0000)
This should have been committed along with rev. 1.36 of Main.c (and
others) yesterday, but for some reason it got left out.

Change the way Main.main is run, so it now doesn't force the return
value.  Now 'main = return undefined' will run and exit successfully.

The change affects finalizers too - but since they have type IO (), it
won't do any harm not to evaluate the ().

ghc/rts/RtsAPI.c

index 529135e..b92794c 100644 (file)
@@ -1,5 +1,5 @@
 /* ----------------------------------------------------------------------------
- * $Id: RtsAPI.c,v 1.42 2003/02/06 10:04:57 simonmar Exp $
+ * $Id: RtsAPI.c,v 1.43 2003/03/18 10:28:15 simonmar Exp $
  *
  * (c) The GHC Team, 1998-2001
  *
@@ -415,16 +415,16 @@ rts_evalIO (HaskellObj p, /*out*/HaskellObj *ret)
 }
 
 /*
- * Identical to rts_evalIO(), but won't create a new task/OS thread
+ * Identical to rts_evalLazyIO(), but won't create a new task/OS thread
  * to evaluate the Haskell thread. Used by main() only. Hack.
  */
  
 SchedulerStatus
-rts_mainEvalIO(HaskellObj p, /*out*/HaskellObj *ret)
+rts_mainLazyIO(HaskellObj p, /*out*/HaskellObj *ret)
 {
     StgTSO* tso;
     
-    tso = createStrictIOThread(RtsFlags.GcFlags.initialStkSize, p);
+    tso = createIOThread(RtsFlags.GcFlags.initialStkSize, p);
     scheduleThread(tso);
     return waitThread(tso, ret);
 }