commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jfcl...@apache.org
Subject svn commit: r232839 - /jakarta/commons/proper/daemon/trunk/src/native/unix/native/jsvc-unix.c
Date Mon, 15 Aug 2005 17:44:06 GMT
Author: jfclere
Date: Mon Aug 15 10:44:02 2005
New Revision: 232839

URL: http://svn.apache.org/viewcvs?rev=232839&view=rev
Log:
fix 36030. Note that it requires /proc to be mounted.

Modified:
    jakarta/commons/proper/daemon/trunk/src/native/unix/native/jsvc-unix.c

Modified: jakarta/commons/proper/daemon/trunk/src/native/unix/native/jsvc-unix.c
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/daemon/trunk/src/native/unix/native/jsvc-unix.c?rev=232839&r1=232838&r2=232839&view=diff
==============================================================================
--- jakarta/commons/proper/daemon/trunk/src/native/unix/native/jsvc-unix.c (original)
+++ jakarta/commons/proper/daemon/trunk/src/native/unix/native/jsvc-unix.c Mon Aug 15 10:44:02
2005
@@ -631,8 +631,9 @@
     if (strcmp(argv[0],args->procname)!=0) {
         char *oldpath=getenv("LD_LIBRARY_PATH");
         char *libf=java_library(args,data);
-        char *old=argv[0];
+        char *filename;
         char buf[2048];
+        int  ret;
         char *tmp=NULL;
         char *p1=NULL;
         char *p2=NULL;
@@ -653,9 +654,18 @@
 
         log_debug("Invoking w/ LD_LIBRARY_PATH=%s",getenv("LD_LIBRARY_PATH"));
 
+        /* execve needs a full path */
+        ret = readlink("/proc/self/exe",buf,sizeof(buf)-1);
+        if (ret<=0)
+          strcpy(buf,argv[0]);
+        else
+          buf[ret]='\0';
+  
+        filename=buf;
+
         argv[0]=args->procname;
-        execve(old,argv,environ);
-        log_error("Cannot execute JSVC executor process");
+        execve(filename,argv,environ);
+        log_error("Cannot execute JSVC executor process (%s)",filename);
         return(1);
     }
     log_debug("Running w/ LD_LIBRARY_PATH=%s",getenv("LD_LIBRARY_PATH"));



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message