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

Unified Diff: runtime/bin/directory_macos.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_linux.cc ('k') | runtime/bin/embedded_dart_io.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/directory_macos.cc
diff --git a/runtime/bin/directory_macos.cc b/runtime/bin/directory_macos.cc
index a10b20a98a350adef41242d6462417ea8cffa80f..5c0f5a6efe02987b8d4363d5223d1a1d2198d9d1 100644
--- a/runtime/bin/directory_macos.cc
+++ b/runtime/bin/directory_macos.cc
@@ -369,15 +369,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_linux.cc ('k') | runtime/bin/embedded_dart_io.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698