X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=win32%2Fperlhost.h;h=78074955b44dfd32fb0943a87a04e40827956c3b;hb=22d4bb9ccb8701e68f9243547d7e3a3c55f70908;hp=ea0d31d9dddec698ff3bb5b3feee25cba70e0e65;hpb=4b19af017623bfa3bb72bb164598a517f586e0d3;p=p5sagit%2Fp5-mst-13.2.git diff --git a/win32/perlhost.h b/win32/perlhost.h index ea0d31d..7807495 100644 --- a/win32/perlhost.h +++ b/win32/perlhost.h @@ -940,7 +940,7 @@ PerlLIOFlock(struct IPerlLIO* piPerl, int fd, int oper) int PerlLIOFileStat(struct IPerlLIO* piPerl, int handle, struct stat *buffer) { - return fstat(handle, buffer); + return win32_fstat(handle, buffer); } int @@ -1666,6 +1666,11 @@ win32_start_child(LPVOID arg) w32_pseudo_id = id; #else w32_pseudo_id = GetCurrentThreadId(); + if (IsWin95()) { + int pid = (int)w32_pseudo_id; + if (pid < 0) + w32_pseudo_id = -pid; + } #endif if (tmpgv = gv_fetchpv("$", TRUE, SVt_PV)) sv_setiv(GvSV(tmpgv), -(IV)w32_pseudo_id); @@ -1746,7 +1751,13 @@ PerlProcFork(struct IPerlProc* piPerl) #ifdef USE_ITHREADS DWORD id; HANDLE handle; - CPerlHost *h = new CPerlHost(*(CPerlHost*)w32_internal_host); + CPerlHost *h; + + if (w32_num_pseudo_children >= MAXIMUM_WAIT_OBJECTS) { + errno = EAGAIN; + return -1; + } + h = new CPerlHost(*(CPerlHost*)w32_internal_host); PerlInterpreter *new_perl = perl_clone_using((PerlInterpreter*)aTHXo, 1, h->m_pHostperlMem, h->m_pHostperlMemShared, @@ -1775,6 +1786,11 @@ PerlProcFork(struct IPerlProc* piPerl) errno = EAGAIN; return -1; } + if (IsWin95()) { + int pid = (int)id; + if (pid < 0) + id = -pid; + } w32_pseudo_child_handles[w32_num_pseudo_children] = handle; w32_pseudo_child_pids[w32_num_pseudo_children] = id; ++w32_num_pseudo_children; @@ -2202,7 +2218,7 @@ CPerlHost::CreateLocalEnvironmentStrings(VDir &vDir) dwEnvIndex = 0; lpLocalEnv = GetIndex(dwEnvIndex); while(*lpEnvPtr != '\0') { - if(lpLocalEnv == NULL) { + if(!lpLocalEnv) { // all environment overrides have been added // so copy string into place strcpy(lpStr, lpEnvPtr); @@ -2234,6 +2250,16 @@ CPerlHost::CreateLocalEnvironmentStrings(VDir &vDir) } } + while(lpLocalEnv) { + // still have environment overrides to add + // so copy the strings into place + strcpy(lpStr, lpLocalEnv); + nLength = strlen(lpLocalEnv) + 1; + lpStr += nLength; + lpEnvPtr += nLength; + lpLocalEnv = GetIndex(dwEnvIndex); + } + // add final NULL *lpStr = '\0'; }