Details
Diff Detail
Event Timeline
Refactor unit test helpers. Check if pwh.h is available in every place that requires it.
Gentle ping. This patch includes a small unit test helpers refactoring that I would like to use in other patches.
Can you give an overview of when the HOME environment variable is not defined?
Cheers,
Rafael
lib/Support/Unix/Path.inc | ||
---|---|---|
558 | Why 1024? | |
574 | I'm not certain whether Dir is required here or not, but knowing its type would be good. We only use auto when the type is already spelled out, or when it's difficult to spell out (like some iterators). | |
584 | Is getpwuid() more reliable than reading the environment variable? |
lib/Support/Unix/Path.inc | ||
---|---|---|
558 | It is suggested initial buffer size returned by sysconf(_SC_GETPW_R_SIZE_MAX). |
lib/Support/Unix/Path.inc | ||
---|---|---|
558 | Ah, good to know, thank you! | |
584 | I was under the impression (which may be incorrect) that getpwuid() was a safer, more reliable way to get the home directory, when the API is available, and the environment variable is more of a backup plan. If that is true, it would make sense to call getHomeDirFromPasswd() first, and fallback to getenv(). |
E.g. in llvm-lit testing environment.
Isn't the intention precisely to avoid tests creating files in the
home directory or being dependent on global config entries?
Cheers,
Rafael
I'm not sure.
- Temp directory does not fallback to $HOME.
- Setting $HOME to "" might be a workaround.
- On Windows Windows API is used to find out the user's home dir in case information from environment variables are not enough.
I don't really need this change, so if you believe it is an overkill, I'm happy to drop it.
Added authors/reviewers of original patch adding home_directory() function in http://reviews.llvm.org/D2199
Do you have any opinion about my patch? I don't insist on it to be merged.
Why 1024?