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

Issue 10824159: Make Directory::Current() work with unenhanced POSIX getcwd (Closed)

Created:
8 years, 4 months ago by jackpal
Modified:
8 years, 4 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Make Directory::Current() work with unenhanced POSIX getcwd POSIX says getcwd needs to be passed a pre-allocated buffer, but many platforms provide an extended version of getcwd that will allocate a buffer when called with arguments (NULL, 0). Display::Current() was depending upon this extended behavior, which happens to work on Linux and Mac platforms, but which doesn't work on other POSIX platforms (such as Android.) Fixed by using the preprocessor to choose between two implementations of Display::Current, one of which depends upon the extended semantics of getcwd, the other of which only depends upon the standard semantics of getcwd. BUG= Committed: https://code.google.com/p/dart/source/detail?r=10309

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+26 lines, -0 lines) Patch
M runtime/bin/directory_posix.cc View 1 chunk +26 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
jackpal
Hi Mads and Søren, This is the first of several changes I will be submitting ...
8 years, 4 months ago (2012-08-06 20:34:45 UTC) #1
siva
I noticed that this change was submitted without a LGTM from the reviewers. Normally we ...
8 years, 4 months ago (2012-08-06 22:03:09 UTC) #2
siva
8 years, 4 months ago (2012-08-06 22:07:13 UTC) #3
DBC:

One of the reasons why Ivan and I have been staunchly against having *_posix.cc
files is precisely this. There are always minor or major differences between
these platform and one ends with #if ... #endif stuff which makes the code
unreadable.

It seems always better to have _linux.cc _macos.cc and _xxx.cc files which makes
the code clear even if there is some repetition of code.

If the OS specific API is designed correctly the amount of code repetition will
be minimal.

Powered by Google App Engine
This is Rietveld 408576698