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

Unified Diff: runtime/bin/directory_android.cc

Issue 1800863002: Cleanup in //runtime/bin (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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/directory.cc ('k') | runtime/bin/directory_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/directory_android.cc
diff --git a/runtime/bin/directory_android.cc b/runtime/bin/directory_android.cc
index 6571f18f86008e0e87e1cb40731747a58439fe92..bb190b2b4ca8374d03bdd2d76afc09c9cb43289b 100644
--- a/runtime/bin/directory_android.cc
+++ b/runtime/bin/directory_android.cc
@@ -366,9 +366,8 @@ Directory::ExistsResult Directory::Exists(const char* dir_name) {
char* Directory::CurrentNoScope() {
// Android's getcwd adheres closely to the POSIX standard. It won't
// allocate memory. We need to make our own copy.
-
char buffer[PATH_MAX];
- if (NULL == getcwd(buffer, PATH_MAX)) {
+ if (getcwd(buffer, PATH_MAX) == NULL) {
return NULL;
}
@@ -377,15 +376,17 @@ char* Directory::CurrentNoScope() {
const char* Directory::Current() {
- char* result = DartUtils::ScopedCString(PATH_MAX);
- ASSERT(result != NULL);
- return getcwd(result, PATH_MAX);
+ char buffer[PATH_MAX];
+ if (getcwd(buffer, PATH_MAX) == NULL) {
+ return NULL;
+ }
+ return DartUtils::ScopedCopyCString(buffer);
}
bool Directory::SetCurrent(const char* path) {
int result = NO_RETRY_EXPECTED(chdir(path));
- return result == 0;
+ return (result == 0);
}
« no previous file with comments | « runtime/bin/directory.cc ('k') | runtime/bin/directory_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698