OLD | NEW |
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 Loading... |
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 Loading... |
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) |
OLD | NEW |