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

Unified Diff: runtime/bin/socket_linux.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/file.h ('k') | runtime/bin/socket_macos.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/socket_linux.cc
diff --git a/runtime/bin/socket_linux.cc b/runtime/bin/socket_linux.cc
index 33e632de0a9e9912d358fbd7143779783560c709..23e492c930f58bb6446b0fb26c896678816d27ad 100644
--- a/runtime/bin/socket_linux.cc
+++ b/runtime/bin/socket_linux.cc
@@ -147,9 +147,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/file.h ('k') | runtime/bin/socket_macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698