tsan: check if PWD env var is absent

On some programs I see:
failed to open suppressions file '<null>/testing/tsan/v2/tsan.supp'

llvm-svn: 169230
This commit is contained in:
Dmitry Vyukov 2012-12-04 07:27:32 +00:00
parent f3d587ea7c
commit d229abe49a
1 changed files with 1 additions and 1 deletions

View File

@ -27,7 +27,7 @@ static char *ReadFile(const char *filename) {
if (filename == 0 || filename[0] == 0)
return 0;
InternalScopedBuffer<char> tmp(4*1024);
if (filename[0] == '/')
if (filename[0] == '/' || GetPwd() == 0)
internal_snprintf(tmp.data(), tmp.size(), "%s", filename);
else
internal_snprintf(tmp.data(), tmp.size(), "%s/%s", GetPwd(), filename);