summaryrefslogtreecommitdiff
path: root/libjava/prims.cc
diff options
context:
space:
mode:
authorgreen <green@138bc75d-0d04-0410-961f-82ee72b054a4>2002-02-07 03:24:12 +0000
committergreen <green@138bc75d-0d04-0410-961f-82ee72b054a4>2002-02-07 03:24:12 +0000
commit2a8dfff3f974ba56056ce7f5ebc5737a6a3f5849 (patch)
tree27d9ff28c3ab0424e26761a6636a9afcbf395114 /libjava/prims.cc
parent434f18a9dac1041b7f31ee5f55943de818e96d91 (diff)
downloadgcc-2a8dfff3f974ba56056ce7f5ebc5737a6a3f5849.tar.gz
embedded updates
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@49562 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/prims.cc')
-rw-r--r--libjava/prims.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/libjava/prims.cc b/libjava/prims.cc
index 55e6da4959a..ec6263caff0 100644
--- a/libjava/prims.cc
+++ b/libjava/prims.cc
@@ -1001,13 +1001,18 @@ _Jv_RunMain (jclass klass, const char *name, int argc, const char **argv,
java::lang::Runtime *runtime = NULL;
+
+#ifdef DISABLE_MAIN_ARGS
+ _Jv_ThisExecutable ("[Embedded App]");
+#else
#ifdef HAVE_PROC_SELF_EXE
char exec_name[20];
sprintf (exec_name, "/proc/%d/exe", getpid ());
_Jv_ThisExecutable (exec_name);
#else
_Jv_ThisExecutable (argv[0]);
-#endif
+#endif /* HAVE_PROC_SELF_EXE */
+#endif /* DISABLE_MAIN_ARGS */
try
{
@@ -1021,7 +1026,11 @@ _Jv_RunMain (jclass klass, const char *name, int argc, const char **argv,
// for `main'; that way it will be set up if `main' is a JNI method.
runtime = java::lang::Runtime::getRuntime ();
+#ifdef DISABLE_MAIN_ARGS
+ arg_vec = JvConvertArgv (0, 0);
+#else
arg_vec = JvConvertArgv (argc - 1, argv + 1);
+#endif
using namespace gnu::gcj::runtime;
if (klass)