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

Unified Diff: runtime/bin/directory_linux.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_android.cc ('k') | runtime/bin/directory_macos.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/directory_linux.cc
diff --git a/runtime/bin/directory_linux.cc b/runtime/bin/directory_linux.cc
index 84301342b46433b193559a9b247b3333e2227892..d099b0e27b626f27c4471bc9192546ec10758726 100644
--- a/runtime/bin/directory_linux.cc
+++ b/runtime/bin/directory_linux.cc
@@ -366,11 +366,7 @@ Directory::ExistsResult Directory::Exists(const char* dir_name) {
char* Directory::CurrentNoScope() {
- char buffer[PATH_MAX];
- if (getcwd(buffer, PATH_MAX) == NULL) {
- return NULL;
- }
- return strdup(buffer);
+ return getcwd(NULL, 0);
}
@@ -384,7 +380,7 @@ const char* Directory::Current() {
bool Directory::SetCurrent(const char* path) {
- return NO_RETRY_EXPECTED(chdir(path)) == 0;
+ return (NO_RETRY_EXPECTED(chdir(path)) == 0);
}
@@ -469,7 +465,7 @@ bool Directory::Rename(const char* path, const char* new_path) {
if (exists != EXISTS) {
return false;
}
- return NO_RETRY_EXPECTED(rename(path, new_path)) == 0;
+ return (NO_RETRY_EXPECTED(rename(path, new_path)) == 0);
}
} // namespace bin
« no previous file with comments | « runtime/bin/directory_android.cc ('k') | runtime/bin/directory_macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698