summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2009-06-04 08:55:32 +0000
committerJohnny Willemsen <jwillemsen@remedy.nl>2009-06-04 08:55:32 +0000
commit0ba5fba0f38c4d88d4209ac5895dc521de8efbdb (patch)
tree36098e69944beb49bf506bfad20bf79dee4c6f8b
parent648f2af6a2bb2d1cd2e0288a9fb3fe6434db8860 (diff)
downloadATCD-0ba5fba0f38c4d88d4209ac5895dc521de8efbdb.tar.gz
Thu Jun 4 08:56:05 2009 Johnny Willemsen <jwillemsen@remedy.nl>
* ace/OS_NS_unistd.inl (isatty): Check the return value of _open_osfhandle, if it returns -1, it failed and then calling _isatty with -1 will cause an assert of the msvc9 runtime
-rw-r--r--ACE/ChangeLog7
-rw-r--r--ACE/ace/OS_NS_unistd.inl8
2 files changed, 13 insertions, 2 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog
index 44aad78ff37..fdfd272ae07 100644
--- a/ACE/ChangeLog
+++ b/ACE/ChangeLog
@@ -1,3 +1,10 @@
+Thu Jun 4 08:56:05 2009 Johnny Willemsen <jwillemsen@remedy.nl>
+
+ * ace/OS_NS_unistd.inl (isatty):
+ Check the return value of _open_osfhandle, if it returns -1,
+ it failed and then calling _isatty with -1 will cause an
+ assert of the msvc9 runtime
+
Wed Jun 3 07:52:05 2009 Johnny Willemsen <jwillemsen@remedy.nl>
* bin/PerlACE/ProcessWinCE.pm:
diff --git a/ACE/ace/OS_NS_unistd.inl b/ACE/ace/OS_NS_unistd.inl
index 9765a0ece92..414cb40688b 100644
--- a/ACE/ace/OS_NS_unistd.inl
+++ b/ACE/ace/OS_NS_unistd.inl
@@ -623,8 +623,12 @@ ACE_OS::isatty (ACE_HANDLE handle)
return 0;
#else
int const fd = ::_open_osfhandle (intptr_t (handle), 0);
- int const status = ::_isatty (fd);
- ::_close (fd);
+ int status = 0;
+ if (fd != -1)
+ {
+ status = ::_isatty (fd);
+ ::_close (fd);
+ }
return status;
#endif /* ACE_LACKS_ISATTY */
}