Skip to content

Commit b911e8e

Browse files
[WIP] exit code
1 parent a0647e1 commit b911e8e

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

runtime/src/CoreClr.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ void CoreClr::CreateAppDomain(alt::IServer* server, alt::IResource* resource, co
275275

276276
if (executable) {
277277
server->LogInfo(alt::String("coreclr-module: Prepare for executing assembly:") + executablePath);
278-
unsigned int exitCode = 0;
278+
int exitCode = -1;
279279
const char* args[1];
280280
char resourceIndexChar = resourceIndex + '0';
281281
char resourceIndexString[1];
@@ -287,20 +287,21 @@ void CoreClr::CreateAppDomain(alt::IServer* server, alt::IResource* resource, co
287287
1,
288288
args,
289289
executablePath.CStr(),
290-
&exitCode
290+
(unsigned int*)&exitCode
291291
);
292292

293293
if (result < 0) {
294+
exitCode = -1;
294295
server->LogInfo(
295-
alt::String("coreclr-module: Unable to execute assembly in app path:") + executablePath + " exitCode:" +
296-
exitCode);
296+
alt::String("coreclr-module: Unable to execute assembly in app path:") + executablePath);
297+
this->PrintError(server, result);
297298
} else {
298299
server->LogInfo("coreclr-module: Assembly executed");
299-
char* x_str = new char[10];
300+
/*char* x_str = new char[10];
300301
sprintf(x_str, "exit code: %d", exitCode);
301302
server->LogInfo(
302303
alt::String(x_str));
303-
delete[] x_str;
304+
delete[] x_str;*/
304305
}
305306
}
306307
}

0 commit comments

Comments
 (0)