Skip to content

Commit

Permalink
Merge pull request #21458 from perrozzi/sherpaTMP
Browse files Browse the repository at this point in the history
set TMPDIR variable to soft link pointing to PWD 93x
  • Loading branch information
cmsbuild authored Nov 24, 2017
2 parents 0a096db + c9b9e92 commit 1e8e6c7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions GeneratorInterface/SherpaInterface/src/SherpackUtilities.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include "GeneratorInterface/SherpaInterface/interface/SherpackUtilities.h"
#include <unistd.h>
#include <cstdlib>

namespace spu {

// functions for inflating (and deflating)
Expand Down Expand Up @@ -153,6 +155,13 @@ void zerr(int ret)
/* compress or decompress from stdin to stdout */
int Unzip(std::string infile, std::string outfile)
{
std::string tmpdir = getenv("TMPDIR");
if (tmpdir.size() > 50 ){
std::string command = "ln -s $PWD "+tmpdir+"/tmp;";
system(command.c_str());
command = tmpdir+"/tmp";
setenv("TMPDIR",command.c_str(), true);
}
int ret;
FILE *in = fopen(infile.c_str(),"r");
if (!in) return -1;
Expand Down

0 comments on commit 1e8e6c7

Please sign in to comment.