Skip to content
Snippets Groups Projects

Get tmp dir from environment (also check TMP and TEMP)

Merged Volodymyr Yurchenko requested to merge vyurchen/jalien-root:master into master
1 file
+ 14
10
Compare changes
  • Side-by-side
  • Inline
+ 14
10
@@ -43,6 +43,20 @@ TJAlien::TJAlien (const char* gridUrl, const char* uId, const char* passwd,
fGrid = "alien";
gGrid = this;
if (getenv("HOME") != NULL)
homedir = getenv("HOME");
else
homedir = "~";
if (getenv("TMPDIR") != NULL)
tmpdir = getenv("TMPDIR");
else if (getenv("TMP") != NULL)
tmpdir = getenv("TMP");
else if (getenv("TEMP") != NULL)
tmpdir = getenv("TEMP");
else
tmpdir = P_tmpdir;
CreateConnection();
}
@@ -69,16 +83,6 @@ void TJAlien::CreateConnection()
readBuffer = "";
// Load certificate
if (getenv("HOME") == NULL)
homedir = "~";
else
homedir = getenv("HOME");
if (getenv("TMPDIR") == NULL)
tmpdir = P_tmpdir;
else
tmpdir = getenv("TMPDIR");
std::stringstream tokencert_s, tokenkey_s;
tokencert_s << tmpdir << "/tokencert_" << getuid() << ".pem";
Loading