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

Side by Side Diff: runtime/bin/platform_android.cc

Issue 2843343002: [dart:io] Make Platform.localeName fall back on en_US if LANG is not defined (Closed)
Patch Set: Created 3 years, 7 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 | runtime/bin/platform_fuchsia.cc » ('j') | 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 #include "platform/globals.h" 5 #include "platform/globals.h"
6 #if defined(HOST_OS_ANDROID) 6 #if defined(HOST_OS_ANDROID)
7 7
8 #include "bin/platform.h" 8 #include "bin/platform.h"
9 9
10 #include <signal.h> // NOLINT 10 #include <signal.h> // NOLINT
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 return "lib"; 51 return "lib";
52 } 52 }
53 53
54 54
55 const char* Platform::LibraryExtension() { 55 const char* Platform::LibraryExtension() {
56 return "so"; 56 return "so";
57 } 57 }
58 58
59 59
60 const char* Platform::LocaleName() { 60 const char* Platform::LocaleName() {
61 return getenv("LANG"); 61 char* lang = getenv("LANG");
62 if (lang == NULL) {
63 return "en_US";
64 }
65 return lang;
62 } 66 }
63 67
64 68
65 bool Platform::LocalHostname(char* buffer, intptr_t buffer_length) { 69 bool Platform::LocalHostname(char* buffer, intptr_t buffer_length) {
66 return gethostname(buffer, buffer_length) == 0; 70 return gethostname(buffer, buffer_length) == 0;
67 } 71 }
68 72
69 73
70 char** Platform::Environment(intptr_t* count) { 74 char** Platform::Environment(intptr_t* count) {
71 // Using environ directly is only safe as long as we do not 75 // Using environ directly is only safe as long as we do not
(...skipping 19 matching lines...) Expand all
91 95
92 96
93 void Platform::Exit(int exit_code) { 97 void Platform::Exit(int exit_code) {
94 exit(exit_code); 98 exit(exit_code);
95 } 99 }
96 100
97 } // namespace bin 101 } // namespace bin
98 } // namespace dart 102 } // namespace dart
99 103
100 #endif // defined(HOST_OS_ANDROID) 104 #endif // defined(HOST_OS_ANDROID)
OLDNEW
« no previous file with comments | « no previous file | runtime/bin/platform_fuchsia.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698