mirror of
https://github.com/mirror/wget.git
synced 2025-01-21 09:41:06 +08:00
[svn] Fix fake_fork error handling for Windows 98.
Patch by David Fritz.
This commit is contained in:
parent
a633f27a99
commit
bf4ae09b22
@ -1,3 +1,9 @@
|
|||||||
|
2004-03-25 David Fritz <zeroxdf@att.net>
|
||||||
|
|
||||||
|
* mswindows.c (fake_fork_child): Ignore error code when
|
||||||
|
OpenFileMapping() fails; assume it failed because the object does
|
||||||
|
not exist.
|
||||||
|
|
||||||
2004-03-24 David Fritz <zeroxdf@att.net>
|
2004-03-24 David Fritz <zeroxdf@att.net>
|
||||||
|
|
||||||
* mswindows.c (fake_fork): New function.
|
* mswindows.c (fake_fork): New function.
|
||||||
|
@ -158,19 +158,15 @@ fake_fork_child (void)
|
|||||||
HANDLE section, event;
|
HANDLE section, event;
|
||||||
struct fake_fork_info *info;
|
struct fake_fork_info *info;
|
||||||
char *name;
|
char *name;
|
||||||
DWORD le;
|
|
||||||
|
|
||||||
name = make_section_name (GetCurrentProcessId ());
|
name = make_section_name (GetCurrentProcessId ());
|
||||||
section = OpenFileMapping (FILE_MAP_WRITE, FALSE, name);
|
section = OpenFileMapping (FILE_MAP_WRITE, FALSE, name);
|
||||||
le = GetLastError ();
|
|
||||||
xfree (name);
|
xfree (name);
|
||||||
|
/* It seems that Windows 9x and NT set last-error inconsistently when
|
||||||
|
OpenFileMapping() fails; so we assume it failed because the section
|
||||||
|
object does not exist. */
|
||||||
if (!section)
|
if (!section)
|
||||||
{
|
return 0; /* We are the parent. */
|
||||||
if (le == ERROR_FILE_NOT_FOUND)
|
|
||||||
return 0; /* Section object does not exist; we are the parent. */
|
|
||||||
else
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
info = MapViewOfFile (section, FILE_MAP_WRITE, 0, 0, 0);
|
info = MapViewOfFile (section, FILE_MAP_WRITE, 0, 0, 0);
|
||||||
if (!info)
|
if (!info)
|
||||||
@ -258,7 +254,7 @@ fake_fork (void)
|
|||||||
if (!event)
|
if (!event)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Creat the child process detached form the current console and in a
|
/* Create the child process detached form the current console and in a
|
||||||
suspended state. */
|
suspended state. */
|
||||||
memset (&si, 0, sizeof (si));
|
memset (&si, 0, sizeof (si));
|
||||||
si.cb = sizeof (si);
|
si.cb = sizeof (si);
|
||||||
|
Loading…
Reference in New Issue
Block a user