Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8BD2617318 for ; Sun, 2 Nov 2014 11:21:34 +0000 (UTC) Received: (qmail 26939 invoked by uid 500); 2 Nov 2014 11:21:34 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 26784 invoked by uid 500); 2 Nov 2014 11:21:34 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 26452 invoked by uid 99); 2 Nov 2014 11:21:34 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Nov 2014 11:21:34 +0000 Date: Sun, 2 Nov 2014 11:21:34 +0000 (UTC) From: "philippe le berre (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (DAEMON-325) missing location in location.c location_jvm_configure for Darwin MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DAEMON-325?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] philippe le berre updated DAEMON-325: ------------------------------------- Attachment: location.c.diff location.c diff/patch > missing location in location.c location_jvm_configure for Darwin > ---------------------------------------------------------------- > > Key: DAEMON-325 > URL: https://issues.apache.org/jira/browse/DAEMON-325 > Project: Commons Daemon > Issue Type: Bug > Components: Jsvc > Affects Versions: 1.0.15 > Environment: Mac OS X and JDK 7 > Reporter: philippe le berre > Priority: Blocker > Attachments: java.c.diff, location.c.diff > > > On OS_DARWIN the native/location.c is missing a location and java.c is missing a check/location for libverify.dylib > --- location.c.old 2014-11-01 18:53:45.000000000 +0100 > +++ location.c 2014-11-01 18:54:15.000000000 +0100 > @@ -144,6 +144,7 @@ char *location_jvm_default[] = { > char *location_jvm_configured[] = { > #if defined(OS_DARWIN) > "$JAVA_HOME/../Libraries/lib$VM_NAME.dylib", > + "$JAVA_HOME/jre/lib/$VM_NAME/libjvm.dylib", > #elif defined(OS_CYGWIN) > "$JAVA_HOME/jre/bin/$VM_NAME/jvm.dll", /* Sun JDK 1.3 */ > #elif defined(OS_LINUX) || defined(OS_SOLARIS) || defined(OS_BSD) || defined(OS_FREEBSD) || defined(OS_TRU64) > --- /Users/rplb/java.c.orig 2014-11-02 12:00:16.000000000 +0100 > +++ /Users/rplb/java.c 2014-11-02 12:16:25.000000000 +0100 > @@ -135,8 +135,15 @@ > { > #ifdef OS_DARWIN > dso_handle apph = NULL; > - char appf[1024]; > + char repl[1024]; > struct stat sb; > + char *jvm_libs[] = { > + "$JAVA_HOME/../Libraries/libjvm_compat.dylib", > + "$JAVA_HOME/../Libraries/libappshell.dylib", > + "$JAVA_HOME/jre/lib/libverify.dylib", > + NULL, > + }; > + > #endif /* ifdef OS_DARWIN */ > jvm_create_t symb = NULL; > JNINativeMethod nativemethods[2]; > @@ -184,30 +191,33 @@ > JVM 1.4.1 through 1.5.* The library name is libjvm_compat.dylib > starting with JVM 1.6 on OS X 10.6 the library name is libverify.dylib. > */ > - if (replace(appf, 1024, "$JAVA_HOME/../Libraries/libappshell.dylib", > - "$JAVA_HOME", data->path) != 0) { > - log_error("Cannot replace values in loader library"); > - return false; > - } > - if (stat(appf, &sb)) { > - if (replace(appf, 1024, "$JAVA_HOME/../Libraries/libjvm_compat.dylib", > - "$JAVA_HOME", data->path) != 0) { > + x = 0; > + char *appf = NULL; > + while (jvm_libs[x] != NULL) { > + char *orig = jvm_libs[x]; > + int k = 0; > + > + k = replace(repl, 1024, orig, "$JAVA_HOME", data->path); > + if (k != 0) { > log_error("Cannot replace values in loader library"); > return false; > } > - } > - if (stat(appf, &sb)) { > - if (replace(appf, 1024, "$JAVA_HOME/../Libraries/libverify.dylib", > - "$JAVA_HOME", data->path) != 0) { > - log_error("Cannot replace values in loader library"); > - return false; > + > + if (stat(repl, &sb)) { > + log_debug("Cannot load the shell library %s", repl); > + x++; > + } else { > + appf = repl; > + break; > } > } > - apph = dso_link(appf); > - if (apph == NULL) { > - log_error("Cannot load required shell library %s", appf); > + > + if (appf == NULL) { > + log_error("Cannot load none of the required shell library"); > return false; > } > + > + apph = dso_link(appf); > log_debug("Shell library %s loaded", appf); > #endif /* ifdef OS_DARWIN */ > #if defined(OSD_POSIX) -- This message was sent by Atlassian JIRA (v6.3.4#6332)