Cleanup calls to CreateFile throughout.

* dcrt0.cc (__api_fatal): Correctly check for failing return from CreateFile.
* assert.cc (__assert): Don't check return value from CreateFile for NULL.
* fhandler_console.cc (set_console_state_for_spawn): Ditto.
* fork.cc (fork_parent): Ditto.
This commit is contained in:
Christopher Faylor
2002-09-19 15:12:48 +00:00
parent 776044d554
commit 580e99a151
11 changed files with 56 additions and 65 deletions

View File

@@ -60,13 +60,9 @@ open_shared (const char *name, int n, HANDLE &shared_h, DWORD size, void *addr)
TRUE, mapname);
}
if (!shared_h &&
!(shared_h = CreateFileMappingA (INVALID_HANDLE_VALUE,
&sec_all,
PAGE_READWRITE,
0,
size,
mapname)))
api_fatal ("CreateFileMappingA, %E. Terminating.");
!(shared_h = CreateFileMapping (INVALID_HANDLE_VALUE, &sec_all,
PAGE_READWRITE, 0, size, mapname)))
api_fatal ("CreateFileMapping, %E. Terminating.");
}
shared = (shared_info *) MapViewOfFileEx (shared_h,