OSDN Git Service

Merged gcj-eclipse branch to trunk.
[pf3gnuchains/gcc-fork.git] / libjava / java / lang / natRuntime.cc
index 3df5cdd..ecaf7d3 100644 (file)
@@ -1,6 +1,6 @@
 // natRuntime.cc - Implementation of native side of Runtime class.
 
-/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005  Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006  Free Software Foundation
 
    This file is part of libgcj.
 
@@ -21,15 +21,18 @@ details.  */
 #include <java/lang/Runtime.h>
 #include <java/lang/UnknownError.h>
 #include <java/lang/UnsatisfiedLinkError.h>
-#include <gnu/gcj/runtime/FileDeleter.h>
 #include <gnu/gcj/runtime/FinalizerThread.h>
 #include <java/io/File.h>
 #include <java/util/TimeZone.h>
 #include <java/lang/StringBuffer.h>
 #include <java/lang/Process.h>
-#include <java/lang/ConcreteProcess.h>
 #include <java/lang/ClassLoader.h>
 
+// It is convenient and safe to simply include all of these.
+#include <java/lang/Win32Process.h>
+#include <java/lang/EcosProcess.h>
+#include <java/lang/PosixProcess.h>
+
 #include <jni.h>
 
 #ifdef HAVE_PWD_H
@@ -91,18 +94,19 @@ _Jv_FindSymbolInExecutable (const char *)
 \f
 
 void
+java::lang::Runtime::runFinalizationForExit ()
+{
+  if (finalizeOnExit)
+    _Jv_RunAllFinalizers ();
+}
+
+void
 java::lang::Runtime::exitInternal (jint status)
 {
   // Make status right for Unix.  This is perhaps strange.
   if (status < 0 || status > 255)
     status = 255;
 
-  if (finalizeOnExit)
-    _Jv_RunAllFinalizers ();
-
-  // Delete all files registered with File.deleteOnExit()
-  gnu::gcj::runtime::FileDeleter::deleteOnExitNow ();
-
   ::exit (status);
 }
 
@@ -242,6 +246,8 @@ java::lang::Runtime::init (void)
 {
 #ifdef USE_LTDL
   lt_dlinit ();
+  // Set module load path.
+  lt_dlsetsearchpath (_Jv_Module_Load_Path);
   // Make sure self is opened.
   lt_dlopen (NULL);
 #endif
@@ -284,7 +290,7 @@ java::lang::Runtime::execInternal (jstringArray cmd,
                                   jstringArray env,
                                   java::io::File *dir)
 {
-  return new java::lang::ConcreteProcess (cmd, env, dir);
+  return new _Jv_platform_process (cmd, env, dir);
 }
 
 jint