[prev in list] [next in list] [prev in thread] [next in thread]
List: groovy-scm
Subject: [groovy-scm] [groovy] [4272] trunk/groovy/modules/native_launcher/source/jvmstarter.c: added some pr
From: akaranta () codehaus ! org
Date: 2006-11-29 7:41:48
Message-ID: 20061129074148.12960.qmail () mail ! codehaus ! org
[Download RAW message or body]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><style type="text/css"><!--
#msg DL { border : 1px #006 solid; background-color : #369; padding : 6px; color : \
#fff; } #msg DT { float : left; width : 6em; font-weight : bold; }
#msg DL, #msg DT, #msg UL, #msg LI { font-family : arial,helvetica,sans-serif; \
font-size : 10pt; } h3 { font-family : arial,helvetica,sans-serif; font-size : 10pt; \
font-weight : bold; } #msg PRE { overflow : auto; white-space : normal; \
background-color : #ffc; border : 1px #fc0 solid; padding : 6px; } #msg UL, PRE, \
.diff { overflow : auto; } #patch h4 { font-family : arial,helvetica,sans-serif; \
font-size : 10pt; } #patch h4 { padding: 8px; background : #369; color : #fff; margin \
: 0; } #patch .propset h4, #patch .binary h4 {margin: 0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {background:#eeeeee;padding: 0 0 10px 0;}
#patch .propset .diff, #patch .binary .diff {padding: 10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, \
#patch .copfile {border:1px solid #ccc;margin:10px 0;} #patch .add \
{background:#ddffdd;} #patch .rem {background:#ffdddd;}
#patch .lines, .info {color:#888888;background:#ffffff;}
.diff { width : 100%; }
#msg DL { border : 1px #006 solid; background-color : #369; padding : 6px; color : \
#fff; } #msg DT { float : left; width : 6em; font-weight : bold; }
#msg DL, #msg DT, #msg UL, #msg LI { font-family : arial,helvetica,sans-serif; \
font-size : 10pt; } h3 { font-family : arial,helvetica,sans-serif; font-size : 10pt; \
font-weight : bold; } #msg PRE { overflow : auto; white-space : normal; \
background-color : #ffc; border : 1px #fc0 solid; padding : 6px; } #msg UL, PRE, \
.diff { overflow : auto; } #patch h4 { font-family : arial,helvetica,sans-serif; \
font-size : 10pt; } #patch h4 { padding: 8px; background : #369; color : #fff; margin \
: 0; } #patch .propset h4, #patch .binary h4 {margin: 0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {background:#eeeeee;padding: 0 0 10px 0;}
#patch .propset .diff, #patch .binary .diff {padding: 10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, \
#patch .copfile {border:1px solid #ccc;margin:10px 0;} #patch .add \
{background:#ddffdd;} #patch .rem {background:#ffdddd;}
#patch .lines, .info {color:#888888;background:#ffffff;}
.diff { width : 100%; }
--></style>
<title>[groovy] [4272] trunk/groovy/modules/native_launcher/source/jvmstarter.c: \
added some preliminary code for win dir handling (commented out) and for checking \
that the linux / solaris symlink exists (also commented out)</title> </head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd><a \
href="http://fisheye.codehaus.org/changelog/groovy/?cs=4272">4272</a></dd> \
<dt>Author</dt> <dd>akaranta</dd> <dt>Date</dt> <dd>2006-11-29 01:41:33 -0600 (Wed, \
29 Nov 2006)</dd> </dl>
<h3>Log Message</h3>
<pre>added some preliminary code for win dir handling (commented out) and for \
checking that the linux / solaris symlink exists (also commented out)</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkgroovymodulesnative_launchersourcejvmstarterc">trunk/groovy/modules/native_launcher/source/jvmstarter.c</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkgroovymodulesnative_launchersourcejvmstarterc"></a>
<div class="modfile"><h4>Modified: \
trunk/groovy/modules/native_launcher/source/jvmstarter.c (4271 => 4272)</h4> <pre \
class="diff"> <span class="info">--- \
trunk/groovy/modules/native_launcher/source/jvmstarter.c 2006-11-28 08:23:31 UTC (rev \
4271)
+++ trunk/groovy/modules/native_launcher/source/jvmstarter.c 2006-11-29 07:41:33 UTC \
(rev 4272) </span><span class="lines">@@ -170,7 +170,13 @@
</span><span class="cx"> # endif
, (int)getpid()
);
</span><span class="rem">-
</span><span class="add">+/* // TODO: try this out on linux and uncomment
+ if(!jst_fileExists(procSymlink)) {
+ free(procSymlink);
+ free(execHome);
+ return "";
+ }
+*/
</span><span class="cx"> if(!realpath(procSymlink, execHome)) {
fprintf(stderr, "error: error occurred when trying to find out executable \
location\n"); free(procSymlink);
</span><span class="lines">@@ -407,24 +413,56 @@
</span><span class="cx"> static jboolean appendJarsFromDir(char* dirName, char** \
targetPtr, size_t* targetSize) {
/*
</span><span class="add">+
+ClusApi.h://#define MAX_PATH 260
+MAPIWin.h:#define MAX_PATH 260
+SetupAPI.h:#define SP_MAX_MACHINENAME_LENGTH (MAX_PATH + 3)
+VdmDbg.h:#define MAX_PATH16 255
+WinDef.h:#define MAX_PATH 260
+WinInet.h:#define INTERNET_MAX_PATH_LENGTH 2048
+nmexpert.h:#define EXPERTSTRINGLENGTH MAX_PATH
+npptypes.h:#define MAX_PATH 260
</span><span class="cx"> HANDLE fileHandle;
WIN32_FIND_DATA fdata;
char *jarEntrySpecifier;
</span><span class="add">+ int lastError;
+ jboolean dirNameEndsWithSeparator;
</span><span class="cx">
</span><span class="rem">- jarEntrySpecifier = malloc((strlen(dirName) + 1 + 7) \
* sizeof(char)); </span><span class="add">+ jarEntrySpecifier = \
malloc((strlen(dirName) + 15) * sizeof(char)); </span><span class="cx"> \
if(!jarEntrySpecifier) {
fprintf(stderr, "error: out of mem when accessing dir %s\n", \
dirName); return JNI_FALSE;
}
</span><span class="rem">- strcpy(jarEntrySpecifier, dirName);
</span><span class="add">+ strcpy(jarEntrySpecifier, "\\\\?\\"); // \
see documentation of FindFirstFile + strcat(jarEntrySpecifier, dirName);
</span><span class="cx"> if(jarEntrySpecifier[strlen(jarEntrySpecifier) - 1] != \
JST_FILE_SEPARATOR[0]) strcat(jarEntrySpecifier, JST_FILE_SEPARATOR);
</span><span class="rem">- fileHandle = FindFirstFile(jarEntrySpecifier, \
&fdata); </span><span class="add">+ SetLastError(0);
+ fileHandle = FindFirstFileW(jarEntrySpecifier, &fdata);
</span><span class="cx">
</span><span class="rem">- // If no matching files can be found, the \
GetLastError function returns ERROR_NO_MORE_FILES
- // on error: INVALID_HANDLE_VALUE
- //FindNextFile
- //FindClose
</span><span class="add">+ if(fileHandle == INVALID_HANDLE_VALUE) {
+ fprintf(stderr, "error: opening directory %s failed w/ error code \
%d\n", dirName, (int)GetLastError()); + return JNI_FALSE;
+ }
+
+ if((lastError = GetLastError()) == 0) {
+
+ while(1) {
+ // TODO: do something w/ fdata
+ if(!FindNextFile(fileHandle, &fdata)) break;
+ }
+
+ }
+
+ FindClose(fileHandle);
+
+ lastError = GetLastError();
+ if(lastError != ERROR_NO_MORE_FILES) {
+ fprintf(stderr, "error: error %d occurred when finding jars from \
%s\n", lastError, dirName); + return JNI_FALSE;
+ }
+ return JNI_TRUE;
+
</span><span class="cx"> */
DIR *dir;
struct dirent *entry;
</span>
</pre>
</div>
</div>
</body>
</html>
<hr/>
<p>
To unsubscribe from this list please visit:
</p>
<p>
<a href="http://xircles.codehaus.org/manage_email">http://xircles.codehaus.org/manage_email</a>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic