summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/dcrt0.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2002-09-19 15:12:48 +0000
committerChristopher Faylor <me@cgf.cx>2002-09-19 15:12:48 +0000
commit580e99a151bdeea4141a0bf03f1e57f07d288ee7 (patch)
treeaafb0b3d24468b3f08c848b6c018c261267aca30 /winsup/cygwin/dcrt0.cc
parent776044d5540355f809ee758580a3235d38084b12 (diff)
downloadcygnal-580e99a151bdeea4141a0bf03f1e57f07d288ee7.tar.gz
cygnal-580e99a151bdeea4141a0bf03f1e57f07d288ee7.tar.bz2
cygnal-580e99a151bdeea4141a0bf03f1e57f07d288ee7.zip
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.
Diffstat (limited to 'winsup/cygwin/dcrt0.cc')
-rw-r--r--winsup/cygwin/dcrt0.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc
index ee9d42e3c..52b8202ef 100644
--- a/winsup/cygwin/dcrt0.cc
+++ b/winsup/cygwin/dcrt0.cc
@@ -1057,10 +1057,10 @@ __api_fatal (const char *fmt, ...)
a serious error. */
if (GetFileType (GetStdHandle (STD_ERROR_HANDLE)) != FILE_TYPE_CHAR)
{
- HANDLE h = CreateFileA ("CONOUT$", GENERIC_READ|GENERIC_WRITE,
- FILE_SHARE_WRITE | FILE_SHARE_WRITE, &sec_none,
- OPEN_EXISTING, 0, 0);
- if (h)
+ HANDLE h = CreateFile ("CONOUT$", GENERIC_READ | GENERIC_WRITE,
+ FILE_SHARE_WRITE | FILE_SHARE_WRITE,
+ &sec_none, OPEN_EXISTING, 0, 0);
+ if (h != INVALID_HANDLE_VALUE)
(void) WriteFile (h, buf, len, &done, 0);
}