aboutsummaryrefslogtreecommitdiff
path: root/lib/Support/Unix
diff options
context:
space:
mode:
authorJan Voung <jvoung@chromium.org>2013-11-08 15:49:37 -0800
committerJan Voung <jvoung@chromium.org>2013-11-08 15:49:37 -0800
commit46d366a017ec1b27d1ef6ce697148221d021468f (patch)
treeb09ca8ff47104aa04351839bdcd9bbe9ea431b9b /lib/Support/Unix
parent2796c5b8a31ea88cc24bf3449a95319928c93519 (diff)
Add some temporary diagnostics to GetCurrentDirectory to diagnose mac failures
Some users are reporting Mac assertion errors while linking: Assertion failed: (false && "Could not query current working directory."). Add a perror() call to see what errno is when this fails. BUG=none R=dschuff@chromium.org Review URL: https://codereview.chromium.org/66653003
Diffstat (limited to 'lib/Support/Unix')
-rw-r--r--lib/Support/Unix/Path.inc8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Support/Unix/Path.inc b/lib/Support/Unix/Path.inc
index b82371a7b6..1ee2a1cf74 100644
--- a/lib/Support/Unix/Path.inc
+++ b/lib/Support/Unix/Path.inc
@@ -256,6 +256,14 @@ Path::GetCurrentDirectory() {
#if !defined(__native_client__)
char pathname[MAXPATHLEN];
if (!getcwd(pathname, MAXPATHLEN)) {
+ // @LOCALMOD-BEGIN: Debug Mac SDK issues.
+ char error_buf[160];
+ if (snprintf(error_buf, sizeof(error_buf),
+ "Failed to getcwd w/ MAXPATHLEN: %d\n", MAXPATHLEN) > 0)
+ perror(error_buf);
+ else
+ perror("Failed to getcwd");
+ // @LOCALMOD-END
assert(false && "Could not query current working directory.");
return Path();
}