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

Issue 8533005: Better handling of stdin/stdout/stderr (Closed)

Created:
9 years, 1 month ago by Søren Gjesse
Modified:
9 years, 1 month ago
Reviewers:
Mads Ager (google)
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

Better handling of stdin/stdout/stderr When using stdout/stderr it is no longer necessary to explicitly close the streams for the program to terminate. The automatic close is handled by always closing the associated receive port for write only streams when not waiting for any events. If a close or error handler is installed for stdout/stderr these will still keep the program alive. For stdin better handling of the difference between sockets and pipes have been immplemented. As a special case for stdin when reading from a terminal the a POLLIN signal with 0 available bytes is treated as end-of-file. This will trigger when pressing ctrl-d in a terminal as POLLHUP is not set in that situation. R=ager@google.com BUG= TEST= Committed: https://code.google.com/p/dart/source/detail?r=1507

Patch Set 1 #

Patch Set 2 : Minor fix #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+101 lines, -61 lines) Patch
M runtime/bin/eventhandler.h View 1 chunk +1 line, -0 lines 0 comments Download
M runtime/bin/eventhandler_linux.h View 1 chunk +1 line, -0 lines 0 comments Download
M runtime/bin/eventhandler_linux.cc View 1 chunk +25 lines, -14 lines 0 comments Download
M runtime/bin/eventhandler_macos.h View 1 chunk +1 line, -0 lines 0 comments Download
M runtime/bin/eventhandler_macos.cc View 1 chunk +25 lines, -14 lines 0 comments Download
M runtime/bin/socket_impl.dart View 1 10 chunks +34 lines, -21 lines 1 comment Download
M runtime/bin/socket_stream.dart View 6 chunks +12 lines, -8 lines 0 comments Download
M tests/standalone/src/TimeoutTest.dart View 1 chunk +2 lines, -4 lines 1 comment Download

Messages

Total messages: 2 (0 generated)
Søren Gjesse
9 years, 1 month ago (2011-11-14 13:58:27 UTC) #1
Mads Ager (google)
9 years, 1 month ago (2011-11-14 14:14:23 UTC) #2
LGTM

http://codereview.chromium.org/8533005/diff/2001/runtime/bin/socket_impl.dart
File runtime/bin/socket_impl.dart (left):

http://codereview.chromium.org/8533005/diff/2001/runtime/bin/socket_impl.dart...
runtime/bin/socket_impl.dart:103: if (_isListenSocket()) data |= (1 <<
_LISTENING_SOCKET);
Good catch. :)

http://codereview.chromium.org/8533005/diff/2001/tests/standalone/src/Timeout...
File tests/standalone/src/TimeoutTest.dart (right):

http://codereview.chromium.org/8533005/diff/2001/tests/standalone/src/Timeout...
tests/standalone/src/TimeoutTest.dart:8: new ReceivePort().receive((x, y) =>
null);
Thanks, that's simpler.

Powered by Google App Engine
This is Rietveld 408576698