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

Side by Side Diff: runtime/bin/stdio_patch.dart

Issue 1293433003: Fix arguments passed to FileSystemException from _socketType, when failing to resolve the type. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 patch class _StdIOUtils { 5 patch class _StdIOUtils {
6 static Stdin _getStdioInputStream() { 6 static Stdin _getStdioInputStream() {
7 switch (_getStdioHandleType(0)) { 7 switch (_getStdioHandleType(0)) {
8 case _STDIO_HANDLE_TYPE_TERMINAL: 8 case _STDIO_HANDLE_TYPE_TERMINAL:
9 case _STDIO_HANDLE_TYPE_PIPE: 9 case _STDIO_HANDLE_TYPE_PIPE:
10 case _STDIO_HANDLE_TYPE_SOCKET: 10 case _STDIO_HANDLE_TYPE_SOCKET:
(...skipping 14 matching lines...) Expand all
25 case _STDIO_HANDLE_TYPE_FILE: 25 case _STDIO_HANDLE_TYPE_FILE:
26 return new Stdout._(new IOSink(new _StdConsumer(fd)), fd); 26 return new Stdout._(new IOSink(new _StdConsumer(fd)), fd);
27 default: 27 default:
28 throw new FileSystemException("Unsupported stdin type"); 28 throw new FileSystemException("Unsupported stdin type");
29 } 29 }
30 } 30 }
31 31
32 static int _socketType(nativeSocket) { 32 static int _socketType(nativeSocket) {
33 var result = _getSocketType(nativeSocket); 33 var result = _getSocketType(nativeSocket);
34 if (result is OSError) { 34 if (result is OSError) {
35 throw new FileSystemException("Error retreiving socket type", result); 35 throw new FileSystemException("Error retreiving socket type", "", result);
36 } 36 }
37 return result; 37 return result;
38 } 38 }
39 39
40 static _getStdioHandleType(int fd) native "File_GetStdioHandleType"; 40 static _getStdioHandleType(int fd) native "File_GetStdioHandleType";
41 } 41 }
42 42
43 patch class Stdin { 43 patch class Stdin {
44 /* patch */ int readByteSync() native "Stdin_ReadByte"; 44 /* patch */ int readByteSync() native "Stdin_ReadByte";
45 45
(...skipping 29 matching lines...) Expand all
75 } 75 }
76 return size; 76 return size;
77 } 77 }
78 78
79 static _getTerminalSize(int fd) native "Stdout_GetTerminalSize"; 79 static _getTerminalSize(int fd) native "Stdout_GetTerminalSize";
80 } 80 }
81 81
82 82
83 _getStdioHandle(_NativeSocket socket, int num) native "Socket_GetStdioHandle"; 83 _getStdioHandle(_NativeSocket socket, int num) native "Socket_GetStdioHandle";
84 _getSocketType(_NativeSocket nativeSocket) native "Socket_GetType"; 84 _getSocketType(_NativeSocket nativeSocket) native "Socket_GetType";
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698