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

Unified Diff: runtime/bin/utils_macos.cc

Issue 9720045: Extend dart:io error handling to all socket functions (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments Created 8 years, 9 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/utils_linux.cc ('k') | runtime/bin/utils_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/utils_macos.cc
diff --git a/runtime/bin/utils_macos.cc b/runtime/bin/utils_macos.cc
index 0b4a69fe35bf6d8295046b8f8c963c1d234cc8ad..f364e475700fc02c3e01b21471720b03858b6afb 100644
--- a/runtime/bin/utils_macos.cc
+++ b/runtime/bin/utils_macos.cc
@@ -3,11 +3,26 @@
// BSD-style license that can be found in the LICENSE file.
#include <errno.h>
+#include <netdb.h>
#include "bin/utils.h"
+#include "platform/assert.h"
OSError::OSError() : sub_system_(kSystem), code_(0), message_(NULL) {
set_sub_system(kSystem);
set_code(errno);
SetMessage(strerror(errno));
}
+
+
+void OSError::SetCodeAndMessage(SubSystem sub_system, int code) {
+ set_sub_system(sub_system);
+ set_code(code);
+ if (sub_system == kSystem) {
+ SetMessage(strerror(code));
+ } else if (sub_system == kGetAddressInfo) {
+ SetMessage(gai_strerror(code));
+ } else {
+ UNREACHABLE();
+ }
+}
« no previous file with comments | « runtime/bin/utils_linux.cc ('k') | runtime/bin/utils_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698