extern void d_msg(const char *file, int line, int level, const char *fmt,...);
extern DWORD g_platform_id;
-// from CYGWIN (should be diff between Jan 1 1601 and Jan 1 1970
+// from MicroSoft SDK (KES) is the diff between Jan 1 1601 and Jan 1 1970
#ifdef HAVE_MINGW
#define WIN32_FILETIME_ADJUST 0x19DB1DED53E8000UL //Not sure it works
#else
ch2 = *s2;
s1++;
s2++;
- if (ch1 == 0 || tolower(ch1) != tolower(ch2)) break;
+ if (ch1 == 0 || tolower(ch1) != tolower(ch2)) break;
}
return(ch1 - ch2);
int inquote = 0;
for (const char *cp = cmdline; *cp; cp++)
{
- if (*cp == '"') {
- inquote = !inquote;
- }
- if (!inquote && isspace(*cp))
- break;
+ if (*cp == '"') {
+ inquote = !inquote;
+ }
+ if (!inquote && isspace(*cp))
+ break;
}
-
+
int len = cp - cmdline;
char *rval = (char *)malloc(len+1);
const char *comspec = getenv("COMSPEC");
if (comspec == NULL) // should never happen
- return INVALID_HANDLE_VALUE;
+ return INVALID_HANDLE_VALUE;
char *cmdLine = (char *)alloca(strlen(cmdline) + strlen(comspec) + 16);
}
CloseHandle(hChildStdoutRd);
- hChildStdoutRd = INVALID_HANDLE_VALUE;
+ hChildStdoutRd = INVALID_HANDLE_VALUE;
}
if (mode_write) {
}
CloseHandle(hChildStdinWr);
- hChildStdinWr = INVALID_HANDLE_VALUE;
+ hChildStdinWr = INVALID_HANDLE_VALUE;
}
// spawn program with redirected handles as appropriate
bpipe->worker_pid = (pid_t)
int
close(int fd)
{
- return _close(fd);
+ int rval = _close(fd);
+ if (rval == -1)
+ rval = closesocket(fd);
+ return rval;
}
#ifndef HAVE_WXCONSOLE