args[2] = "-fhardwire-lib-paths";
if ((argc >= 2) && (strcmp(argv[1], "-v") == 0)) {
printf("Using %s %s %s\n", args[0], args[1], args[2]);
+ fflush(stdout);
}
memcpy(args + 3, argv + 1, sizeof(char *) * (argc - 1));
args[argc+2] = NULL;
int run(char *this, char *program, int argc, char** argv) {
TCHAR programShort[MAX_PATH+1];
DWORD dwSize;
+ DWORD dwExitCode;
int i;
char* new_cmdline;
char *ptr;
switch (WaitForSingleObject(pi.hProcess, INFINITE) ) {
case WAIT_OBJECT_0:
- return 0;
+ if (GetExitCodeProcess(pi.hProcess, &dwExitCode)) {
+ return dwExitCode;
+ }
+ else {
+ return 1;
+ }
case WAIT_ABANDONED:
case WAIT_FAILED:
/* in the event we get any hard errors, bring the child