You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by jf...@apache.org on 2004/08/02 18:07:55 UTC
cvs commit: jakarta-commons/daemon/src/native/unix/native java.c
jfclere 2004/08/02 09:07:55
Modified: daemon/src/native/unix/native java.c
Log:
exit(123) so that the JVM is automaticly restarted when it aborts.
Revision Changes Path
1.4 +16 -12 jakarta-commons/daemon/src/native/unix/native/java.c
Index: java.c
===================================================================
RCS file: /home/cvs/jakarta-commons/daemon/src/native/unix/native/java.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- java.c 9 Feb 2004 15:55:21 -0000 1.3
+++ java.c 2 Aug 2004 16:07:55 -0000 1.4
@@ -44,6 +44,11 @@
if (reload==TRUE) main_reload();
else main_shutdown();
}
+/* Automaticly restart when the JVM crashes */
+static void java_abort123()
+{
+ exit(123);
+}
char *java_library(arg_data *args, home_data *data) {
char *libf=NULL;
@@ -149,17 +154,16 @@
arg.version=JNI_VERSION_1_2;
arg.ignoreUnrecognized=FALSE;
arg.nOptions=args->onum;
- if (arg.nOptions==0) {
- arg.options=NULL;
- } else {
- opt=(JavaVMOption *)malloc(arg.nOptions*sizeof(JavaVMOption));
- for (x=0; x<args->onum; x++) {
- opt[x].optionString=strdup(args->opts[x]);
- jsvc_xlate_to_ascii(opt[x].optionString);
- opt[x].extraInfo=NULL;
- }
- arg.options=opt;
- }
+ arg.nOptions++; /* Add abort code */
+ opt=(JavaVMOption *)malloc(arg.nOptions*sizeof(JavaVMOption));
+ for (x=0; x<args->onum; x++) {
+ opt[x].optionString=strdup(args->opts[x]);
+ jsvc_xlate_to_ascii(opt[x].optionString);
+ opt[x].extraInfo=NULL;
+ }
+ opt[x].optionString="abort";
+ opt[x].extraInfo=java_abort123;
+ arg.options=opt;
/* Do some debugging */
if (log_debug_flag==true) {
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org