Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(893)

Unified Diff: runtime/bin/socket_macos.cc

Issue 13636003: Fix a number of issues with determining the type of stdio (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/socket_linux.cc ('k') | runtime/bin/stdio_patch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/socket_macos.cc
diff --git a/runtime/bin/socket_macos.cc b/runtime/bin/socket_macos.cc
index b11da008c7b82dccab4105668470204d27e3dd14..ff1e28eca55dd7173e75592b9d948ae64eb1d9b9 100644
--- a/runtime/bin/socket_macos.cc
+++ b/runtime/bin/socket_macos.cc
@@ -143,9 +143,9 @@ void Socket::GetError(intptr_t fd, OSError* os_error) {
int Socket::GetType(intptr_t fd) {
struct stat buf;
- if (isatty(fd)) return File::kTerminal;
int result = fstat(fd, &buf);
if (result == -1) return -1;
+ if (S_ISCHR(buf.st_mode)) return File::kTerminal;
if (S_ISFIFO(buf.st_mode)) return File::kPipe;
if (S_ISREG(buf.st_mode)) return File::kFile;
return File::kOther;
« no previous file with comments | « runtime/bin/socket_linux.cc ('k') | runtime/bin/stdio_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698