diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 2000-08-17 00:19:20 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 2000-08-17 00:19:20 +0000 |
commit | 922b18888a177879df1569d1969abfcaa0090a6f (patch) | |
tree | 4385d58bf1179ca62684b41fbc028e6b3bc35d48 /win32/perlhost.h | |
parent | 8af02333c93343b2ed2e522e4fa455023e6cc339 (diff) | |
download | perl-922b18888a177879df1569d1969abfcaa0090a6f.tar.gz |
waitpid() now handles externally spawned pids correctly;
fixes for backtick/wait/waitpid failures on Windows 9x
these changes make the pid returned by process functions on
Windows 9x always positive by clearing the high bit (which
is always set on Win9x); pseudo-process PIDs are likewise
always negative now on Win9x (just as on NT/2000)
p4raw-id: //depot/perl@6661
Diffstat (limited to 'win32/perlhost.h')
-rw-r--r-- | win32/perlhost.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/win32/perlhost.h b/win32/perlhost.h index 3b1d8ca282..4509a2cad4 100644 --- a/win32/perlhost.h +++ b/win32/perlhost.h @@ -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); @@ -1781,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; |